Added Knuth–Morris–Pratt algorithm