KMP & the Z-Algorithm
The naive substring scan tries the pattern at every text position and, on a mismatch, throws away
The naive substring scan tries the pattern at every text position and, on a mismatch, throws away
The obvious way to find a pattern of length m inside a text of length n is to try it at every