Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Border, failure function?

Dikenal juga sebagai: border (word) · failure function

Definition 25.5 University Computer Science — Year 2 · Bab 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.
Baca dalam konteks →