Thanks! I am grad you liked it.
Yeah, it is not covering the Bad Character rule, but is still better than brute force method in majority of cases. Also, when I started to understand the algorithm, I was not very much clear. So, when I understood it, I thought of blogging it to help others get started. :)
0 · July 13, 2012
Was pretty awesome, despite the slight tension headache i got :)
Am wondering, what if i loop through entire text string, recording the index position of the first letter in my pattern. Then, go back to each of those indeces +1 and record them if i find my second char from the pattern - repeat till done.
That would give O(m*n) as well, no?
0 · July 12, 2012