Why it matters
KMP is elegant linear string search. Foundation of many string libs.
Advertisement
The architecture
Build failure table.
Scan text with rewinds via table.
O(n + m).
Advertisement
How it works end to end
KMP 1977.
Failure table.
No backtracking.