1The Knuth-Morris-Pratt Algorithm - CMU School of …
https://www.cs.cmu.edu/~15451-f17/lectures/lec09-kmp.pdf
WEBthe total run-time of the search algorithm would be f(P) + O(t). It is easy to construct the DFA in time O(p3j j), where recall that is the alphabet. However, the algorithm of Knuth, Morris, and Pratt 2 suggests a way to compute the DFA in only O(pj j) time. The DFA is of size O(pj j), so this is optimal. In fact, their algorithm goes even further.
DA: 46 PA: 37 MOZ Rank: 81