Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
告诉我们 KMP 故障表的正确函数是什么?
我看过一对夫妇,但他们很困惑。我对后缀和前缀以及如何匹配它们感到有些困惑?
我相信我们从开始,-1但0我似乎无法理解表格的其余部分。
-1
0
您可以查看 aho-corasick 算法,并使用 trie 的广度优先遍历计算故障函数。你先走每个级别,每个孩子都排着队。