by Hudson Griffith
The Knuth-Morris-Pratt (KMP) algorithm is an efficient string-matching algorithm that finds occurrences of a pattern string within a main text string. Unlike naive approaches that may involve redundant comparisons, KMP utilizes a preprocessed table called the LPS (Longest Proper Prefix which is also Suffix) to skip unnecessary comparisons.
Enter text and pattern, then press Start to begin visualization.