The KMP Algorithm
Never re-check a character you have already matched. One precomputed table turns pattern matching into a guaranteed O(n + m).
10 min readUpdated 2026-09-03stringskmppattern-matching
Never re-check a character you have already matched. One precomputed table turns pattern matching into a guaranteed O(n + m).