知识卡片

普通读书笔记卡 · 3706.b.2

追加一字符最多增长一位匹配前缀

理解等级:中级

后缀函数满足σ(xa)≤σ(x)+1:若追加a后有长度r的模式前缀匹配文本后缀,删去末字符后,其前r−1字符已经匹配x的后缀。这个上界限制了下一状态的候选范围。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 第32章 字符串匹配 · 查看原书依据

      Lemma 32.2 (Suffix-function inequality) For any string x and character a, we have σ(xa) ≤ σ(x) + 1. Figure 32.7 An illustration for the proof of Lemma 32.2. The figure shows that r ≤ σ(x) + 1, where r = σ(xa). Figure 32.8 An illustration for the proof of Lemma 32.3. The figure shows that r = σ(P[:q]a), where q = σ(x) and r = σ(xa). Proof Referring to Figure 32.7, let r = σ(xa). If r = 0, then the conclusion σ(xa) = r ≤ σ(x)+1 is trivially satisfied since σ(x) is

    参考来源

    - 位置:《算法导论(第4版)》第32章《字符串匹配》(OEBPS/chapter032.xhtml,文本字符[30000,35000))。 - 结论依据:原文第32.3–32.4节对应引理、转移表或前缀函数推导;图式已核对。 - 原始内容:Lemma 32.2 (Suffix-function inequality) For any string x and character a , we have σ ( xa ) ≤ σ ( x ) + 1. Figure 32.7 An illustration for the proof of Lemma 32.2. The figure shows that r ≤ σ ( x ) + 1, where r = σ ( xa ). Figure 32.8 An illustration for the proof of Lemma 32.3. The figure shows that r = σ ( P [: q ] a ), where q = σ ( x ) and r = σ ( xa ). Proof Referring to Figure 32.7 , let r = σ ( xa ). If r = 0, then the conclusion σ ( xa ) = r ≤ σ ( x )+1 is trivially satisfied since σ ( x ) is