Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Rolling hash, spurious hit?

También llamado: rolling hash · spurious hit

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

The rolling hash of a window T[s..s+m−1]T[s..s+m-1] is hs=∑j=0m−1T[s+j] 256m−1−j mod qh_s = \sum_{j=0}^{m-1} T[s + j]\, 256^{m-1-j} \bmod q. It satisfies hs+1=((hs−T[s]⋅256m−1)⋅256+T[s+m]) mod qh_{s+1} = ((h_s - T[s] \cdot 256^{m-1}) \cdot 256 + T[s + m]) \bmod q. A shift whose hash equals the pattern’s, hs=h(P)h_s = h(P), but which is not an occurrence, is a spurious hit.

Leer en el capítulo →