15 September 2006 06:45
Knuth-Morris-Pratt Algorithm
by 1 otherThe problem: given a (short) pattern and a (long) text, both strings, determine whether the pattern appears somewhere in the text. Last time we saw how to do this with finite automata. This time we'll go through the Knuth-Morris-Pratt (KMP) algorithm, which can be thought of as an efficient way to build these automata. I also have some working C source code which might help you understand the algorithm better.
1
(1 marks)