Boyer-Moore

Robert Boyer & J Strother Moore, 1977

O(n + m)

Boyer-Moore is one of the most efficient string matching algorithms in practice. It compares the pattern against the text from right to left, allowing it to skip large portions of the text when a mismatch occurs. The bad character rule shifts the pattern to align the mismatched text character with its rightmost occurrence in the pattern. The visualization shows the sliding window, right-to-left comparison, and skip distances.