next up previous
Next: Up: Previous:

Prefix Array

Example

n e y o y o d y n e y o
    y o y o s          

s = 2



How far can we shift P over and be assured of catching all matches?



Since we have matched up to yoyo and yo is a suffix of yoyo, then we can shift over by 2 and start testing at P[3].


next up previous
Next: Up: Previous: