开发者

Understanding Boyer-Moore string search algorithm's "Good Suffix Shift"-Table

开发者 https://www.devze.com 2023-03-15 01:59 出处:网络
Please help me to understand Boyer-Moore string search algorithm\'s \"Good Suffix Shift\"-Table. What has happened when i==3?

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
0

精彩评论

暂无评论...
验证码 换一张
取 消