ababaca
ababaca is a seven-letter string constructed from the letters a, b, and c. It is widely used in computer science as a canonical example in the study of pattern matching algorithms, particularly the Knuth–Morris–Pratt (KMP) algorithm. The string is used to illustrate how the algorithm computes the prefix function, also known as the partial-match table, and how the derived failure function guides pattern shifts after mismatches.
For ababaca, the prefix function values are 0, 0, 1, 2, 3, 0, 1. Interpreted for each
These values demonstrate nontrivial overlaps and how the KMP preprocessing enables linear-time search by avoiding unnecessary
Outside theoretical discussions, ababaca is generally treated as a conventional demonstration input; it has no intrinsic