What is the most efficient way to do this? There must be some better method other than brute force.
+6
A:
Depends on length of string, size of alphabet and whether repeated searching: Knuth-Morris-Pratt, Rabin-Karp, etc.
Mitch Wheat
2010-10-11 00:20:14