Understanding Boyer-Moore's “Good Suffix Shift” Search Algorithm — Table

Please help me understand the Boyer-Moore string search algorithm "Good Suffix Shift" -Table .

What happened when i==3?

The template does not contain the substring "_MAN". Therefore, the shift value should be equal to 8 (as it was with i==1).

Why is this 6?

+5
source share
1 answer

There is no substring "_MAN", but the string starts with "AN", so if you move to 6, you can get a pattern that looks like this

_ M A N _ _ _ _ _ _
_ _ A N P A N M A N
+6
source

All Articles