全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Border, failure function?

又称: border (word) · failure function

Definition 25.5 University Computer Science — Year 2 · 第 25 章 — Text Algorithms and Compression

A border of a word uu is a word that is both a proper prefix and a proper suffix of uu (the empty word is always one). The failure function of PP is π(q)\pi(q), the length of the longest border of P[0..q−1]P[0..q-1], for 1≤q≤m1 \leq q \leq m.

A mismatch after q = 5 letters of abababc. The matched part ababa has the longest border aba; the pattern moves so that its prefix aba sits under the text’s aba, and the comparison resumes at the same text letter, with q = 3.
A mismatch after q=5q = 5 letters of abababc. The matched part ababa has the longest border aba; the pattern moves so that its prefix aba sits under the text’s aba, and the comparison resumes at the same text letter, with q=3q = 3.
在原文中阅读 →