A fast string searching algorithm

作者: Robert S. Boyer , J. Strother Moore

DOI: 10.1145/359842.359859

关键词:

摘要: An algorithm is presented that searches for the location, “il” of first occurrence a character string, “pat,” in another “string.” During search operation, characters pat are matched starting with last pat. The information gained by match at end pattern often allows to proceed large jumps through text being searched. Thus has unusual property that, most cases, not all i string inspected. number actually inspected (on average) decreases as function length For random English 5, will typically inspect i/4 before finding i. Furthermore, been implemented so fewer than + patlen machine instructions executed. These conclusions supported empirical evidence and theoretical analysis average behavior algorithm. worst case linear patlen, assuming availability array space tables plus size alphabet.

参考文章(3)
Donald E Knuth, James H Morris, Jr, Vaughan R Pratt, Fast Pattern Matching in Strings SIAM Journal on Computing. ,vol. 6, pp. 323- 350 ,(1977) , 10.1137/0206024
Alfred V. Aho, Margaret J. Corasick, Efficient string matching: an aid to bibliographic search Communications of The ACM. ,vol. 18, pp. 333- 340 ,(1975) , 10.1145/360825.360855