SIAM Journal on Computing · 1980 · 31 citations · 11 references
ComputingComputer ScienceAlgorithmsComputational LinguisticsNatural Language ProcessingAlgorithm AnalysisPattern RecognitionSearching AlgorithmsSpace ComplexityString AlgorithmsText Similarity AnalysisComplexity Of String AlgorithmsString SearchString SearchingTwo-way AutomataTwo-way Finite Automata
The string-matching problem is to find all instances (as contiguous substrings) of a “pattern” character string x in a longer “text" string ”. The naive algorithm, trying the pattern from scratch starting at each successive text position, requires only a fixed number of auxiliary storage locations but time proportional to $|x|\cdot|Y|$ (worst case). On the other hand, the fast algorithm of Knuth, Morris, and Pratt requires only time proportional to $|Y|$ but extra space proportional to $|x|$ (every case). Algorithms described in this paper reduce the extra space used by the Knuth–Morris–Pratt algorithm down to $O(\log |x|)$, and the time for the naive algorithm down to $O(|x|^\varepsilon |y|)$ for any fixed $\varepsilon > 0$. Also described are implementations on two-way multihead finite automata and multitape Turing machines.
11
Fast Pattern Matching in Strings
Donald E. Knuth, James H. Morris, Vaughan Pratt · SIAM Journal on Computing · 1977 · 2.9K citations
John E. Hopcroft, Wolfgang J. Paul, Leslie G. Valiant · Journal of the ACM · 1977 · 255 citations · Full text