Knuth–Morris–Pratt algorithm (KMP)



KMP algorithm is an efficient patterns matching algorithm, used for searching occurences of a pattern string in a text string.

Here, we will use text string 'acabaabaabcaccaabc' and pattern string 'abaabcac' to go throught this algorithm. Press when you ready!