Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
请帮助我理解 Boyer-Moore 字符串搜索算法的"Good Suffix Shift"-Table。
什么时候发生了什么i==3?
i==3
模式中没有子字符串“_MAN”。所以移位值应该是 8(就像 时一样i==1)。
i==1
为什么呢6?
6
没有子字符串“_MAN”,但该字符串确实以“AN”开头,所以如果你移动 6,你可以得到一个匹配的模式,如下所示
_ M A N _ _ _ _ _ _ _ _ A N P A N M A N