Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Bad-character rule?

Definition 25.3 University Computer Science — Year 2 · Capítulo 25 — Text Algorithms and Compression

Compare PP with the text at shift ss from the right, and let jj be the position of the first difference, with c=T[s+j]c = T[s + j] the bad character. Let λ(c)\lambda(c) be the last position of cc in PP, or −1-1 if cc does not occur in PP. The bad-character rule moves to the shift s+max⁡(1,j−λ(c))s + \max(1, j - \lambda(c)).

The bad-character rule. The pattern River is compared from its right end; the text’s - differs from r and occurs nowhere in the pattern, so no shift that puts a letter of the pattern under it can match, and the pattern jumps past it.
The bad-character rule. The pattern River is compared from its right end; the text’s - differs from r and occurs nowhere in the pattern, so no shift that puts a letter of the pattern under it can match, and the pattern jumps past it.
Leer en el capítulo →