Nambers / Nambers.github.io

About my blog
https://eritque-arcus.tech/
0 stars 0 forks source link

aho-corasick automaton AC自动机的理解 | Eritque arcus's blog #22

Open Nambers opened 2 years ago

Nambers commented 2 years ago

https://eritque-arcus.tech/2022/01/11/aho-corasick-automaton-(AC%E8%87%AA%E5%8A%A8%E6%9C%BA)%E7%9A%84%E7%90%86%E8%A7%A3/

aho-corasick automaton AC自动机的理解 最近在学编译原理, 里面在3.3节词法单元识别后面就提到了这个算法然后根据网上资料自己做了一遍,只支持英文字母可能最后的效果没有oi-wiki上的效率高 1. 背景大概涉及到的知识: Tire 树,一种字典树,可以看这里做的挺直观的 BFS 广度优先搜索Tire树 状态压缩,随便做的小优化,可能有负效果对于数据量小(x主要思想就是