Understanding Boyer-Moore string search algorithm's "Good Suffix Shift"-Table
Please help me to understand Boyer-Moore string search algorithm's "Good Suffix Shift"-Table.
What has happened when i==3
?
There is no sub-string "_MAN" in the pattern. So the shift value should be 8 (as it was when i==1
).
Why is it 开发者_如何学运维6
?
There is no sub-string "_MAN", but the string does start with "AN", so if you shift over by 6 you could get a pattern that matches as follows
_ M A N _ _ _ _ _ _
_ _ A N P A N M A N
精彩评论