一个字符串搜索的Aho-Corasick算法

Aho和Corasick对KMP算法(Knuth–Morris–Pratt algorithm)进行了改进,Aho-Corasick算法(Aho-Corasick algorithm)利用构建树,总时间复杂度是O(n)。原理图如下(摘自Aho-Corasick string matching in C#): Building of the keyword tree (figure 1 - afte
相关文章
相关标签/搜索