Showing posts with label KMP. Show all posts
Showing posts with label KMP. Show all posts

Monday, 3 January 2011

String Searching – The Knuth-Morris-Pratt Algorithm

We’ve seen how to do the naive approach towards pattern matching. So what about other algorithms that are much more better at doing this task? This is the Knuth-Morris-Pratt (KMP) algorithm for pattern matching.