Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • Do you know a way to combine Boyer-Moore's bad shift table with Two-Way? Glibc does a variant of this for long needles (>32 byte) but only checks the last byte. The problem is that Two-Way needs to search the right portion of the needle left-to-right, whereas Boyer-Moore's bad shift is most efficient when searching from right-to-left. I tried using it with left-to-right in Two-Way (advance by shift table or normal Two-Way right half mismatch, whichever is longer) but I got a 5-10% slowdown versus normal Two-Way in most cases and couldn't find any cases where it improved performance. Commented Jul 6, 2010 at 5:28