知识卡片
全量转移表可预处理到字母表线性
按直接枚举方法计算转移表要O(m³|Σ|),因为要枚举状态和字符、递减候选长度并逐字符检查后缀。
利用预先算出的模式信息可将建表改进到O(m|Σ|),随后扫描文本仍为Θ(n)。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第32章 字符串匹配 · 查看原书依据
Much faster procedures exist. By utilizing some cleverly computed information about the pattern P (see Exercise 32.4-8), the time required to compute δ from P improves to O(m |∑|). This improved procedure for computing δ provides a way to find all occurrences of a length-m pattern in a length-n text over an alphabet ∑ with O(m |∑|) preprocessing time and Θ(n) matching time. Exercises 32.3-1 Draw a state-transition
参考来源
- 位置:《算法导论(第4版)》第32章《字符串匹配》(OEBPS/chapter032.xhtml,文本字符[35000,40000))。
- 结论依据:原文第32.3–32.4节对应引理、转移表或前缀函数推导;图式已核对。
- 原始内容:Much faster procedures exist. By utilizing some cleverly computed information about the pattern P (see Exercise 32.4-8), the time required to compute δ from P improves to O ( m |∑|). This improved procedure for computing δ provides a way to find all occurrences of a length- m pattern in a length- n text over an alphabet ∑ with O ( m |∑|) preprocessing time and Θ( n ) matching time. Exercises 32.3-1 Draw a state-transition