Oddly enough, the links on the right hand side of this page have a very interesting bit-packing way of doing this.
The link is: http://www-igm.univ-mlv.fr/~lecroq/string/node6.html It includes a "truth table" and a java applet visualization, along with a program in 'C'. The program example continues to search the string even after a match is no longer possible, but that's easy to fix. Quite the elegant answer (no recursion however). If you get a string of zero's equal in length to the length of the text you're searching for, you've got a match. Adak --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---