Next:
Up:
Previous:
Knuth-Morris-Pratt Algorithm
Utilize a prefix array
[1..m], where
[q] contains information to compute
(q, a) for (a
), the pattern shift for a mismatch on P[q].
requires only O(m) time (as opposed to O(m
) for
).
Next:
Up:
Previous: