Overview
Boyer-Moore uses mismatch information to shift the pattern farther than one character when possible.
Searches text by comparing from the end of the pattern and making large skips.
Compact metadata for implementation and discovery.
Boyer-Moore uses mismatch information to shift the pattern farther than one character when possible.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n / m)
Average
O(n)
Worst
O(nm)
Space
O(m + a)
shift = max(1, mismatch_index - last_index_of(mismatched_char))Skips alignments based on the mismatched character's last position in the pattern.
Show the pattern jumping over sections of text after mismatches.
Boyer-Moore is especially effective with longer patterns and larger alphabets.
What each reference supports for this entry.
String algorithms reference for Boyer-Moore's pattern matching, suffix indexing, alignment, or sequence-processing mechanism.
Open sourceTextbook support for Boyer-Moore's algorithm family, complexity framing, and standard implementation concepts.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Boyer-Moore skips ahead using bad-character and good-suffix rules.
Wu-Manber extends skip-table ideas to multi-pattern matching.