知识卡片
重叠后缀按长度形成包含关系
若x与y都是同一字符串z的后缀,则较短者也是较长者的后缀;长度相同便相等。
例如z=abc、x=c、y=bc时,c是bc的后缀。
不能反写为“x和y都以z结尾”;该引理支撑后续前缀函数推导。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第32章 字符串匹配 · 查看原书依据
Lemma 32.1 (Overlapping-suffix lemma) Suppose that x, y, and z are strings such that x ⊐ z and y ⊐ z. If |x| ≤ |y|, then x ⊐ y. If |x| ≥ |y|, then y ⊐ x. If |x| = |y|, then x = y. Proof See Figure 32.2 for a graphical proof. ▪ For convenience, denote the k-character prefix P[1:k] of the pattern P[1:m] by P[:k]. Thus, we can write P[:0] = ϵ and P[:m] = P = P[1:m]. Similarly, denote the k-character
参考来源
- 位置:《算法导论(第4版)》第32章《字符串匹配》(OEBPS/chapter032.xhtml,文本字符[5000,10000))。
- 结论依据:第32章定义 w ⊐ x 表示 w 是 x 的后缀;引理32.1以前提 x ⊐ z 且 y ⊐ z 比较二者长度并得出包含关系。
- 原始内容:Lemma 32.1 (Overlapping-suffix lemma) Suppose that x , y , and z are strings such that x ⊐ z and y ⊐ z . If | x | ≤ | y |, then x ⊐ y . If | x | ≥ | y |, then y ⊐ x . If | x | = | y |, then x = y . Proof See Figure 32.2 for a graphical proof. ▪ For convenience, denote the k -character prefix P [1: k ] of the pattern P [1: m ] by P [: k ]. Thus, we can write P [:0] = ϵ and P [: m ] = P = P [1: m ]. Similarly, denote the k -character