Unverified Commit 8c9c9c7c authored by ir1d's avatar ir1d Committed by GitHub
Browse files

Update ac-automaton.md

parent 040702b0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5,8 +5,9 @@
AC 自动机是 **以 TRIE 的结构为基础** ,结合 **KMP 的思想** 建立的。

简单来说,建立一个 AC 自动机有两个步骤:
1\. 基础的 TRIE 结构:将所有的模式串构成一棵 $Trie$ 。
2\. KMP 的思想:对 $Trie$ 树上所有的结点构造失配指针。

1.   基础的 TRIE 结构:将所有的模式串构成一棵 $Trie$ 。
2.   KMP 的思想:对 $Trie$ 树上所有的结点构造失配指针。

然后就可以利用它进行多模式匹配了。