Knuth-Morris-Pratt expect