Core Concept KMP avoids re-examining previously matched characters by using a prefix function (also called failure function). When a mismatch occurs at position i in the pattern, the algorithm knows ...