text: Driver code
code: public static void main ( String [ ] args ) { String txt = " BACDGABCDA " ; String pat = " ABCD " ; if ( search ( pat , txt ) ) System . out . println ( " Yes " ) ; else System . out . println ( " NO " ) ; } }