The KMP failure function: where the pattern goes after a mismatch
How KMP string search picks the pattern position to compare after a mismatch: the f and next tables, how to build them, and why the search is linear, from the 1977 paper and Princeton's code.
DevelopmentAlgorithmsStrings