Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Shift table?

Definition 29.2 High School Computer Science · Capítulo 29 — Searching in Text

The shift table of a pattern pp of length mm gives, for each letter cc, the distance from the last place of cc in pp, the final place excluded, to the final place: m−1−jm - 1 - j, where jj is that last place. A letter absent from the first m−1m - 1 places of pp gets the shift mm.

The shift table of STATION (m = 7). The last T before the final place is at 3, three places from the end: shift 3. N, which appears only in the final place (shaded), and every letter absent from the pattern get 7.
The shift table of STATION (m=7m = 7). The last T before the final place is at 33, three places from the end: shift 33. N, which appears only in the final place (shaded), and every letter absent from the pattern get 77.
Leer en el capítulo →