知识卡片
自动机状态记录最长匹配前缀
模式匹配自动机以0到m为状态,0为初态、m为唯一接受态。
读过文本前缀后,状态q表示模式P最长前缀与已读文本后缀相同的长度;到达m意味着完整模式刚在当前位置结束。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第32章 字符串匹配 · 查看原书依据
, m}. The start state q0 is state 0, and state m is the only accepting state. The transition function δ is defined, for any state q and character a, by As the automaton consumes characters of the text T, it is trying to build a match of the pattern P against the most recently seen characters of T. At any time, the state number q gives the length of the longest prefix of P that matches the most recently seen text characters. Whenever the automaton reaches state m, the m most
参考来源
- 位置:《算法导论(第4版)》第32章《字符串匹配》(OEBPS/chapter032.xhtml,文本字符[25000,30000))。
- 结论依据:原文第32.2–32.3节对应算法、定义或复杂度说明;公式与示意图已核对。
- 原始内容:The state set Q is {0, 1, …, m }. The start state q 0 is state 0, and state m is the only accepting state. The transition function δ is defined, for any state q and character a , by As the automaton consumes characters of the text T , it is trying to build a match of the pattern P against the most recently seen characters of T . At any time, the state number q gives the length of the longest prefix of P that matches the most recently seen text characters. Whenever the automaton reaches state m , the m most