Intuition for Improvement

When could the Naive Algorithm do better?

T = aaaaaaaabaaaaaaaaaaaaaaaaaaaaaa...
P = aaaaaaaaa
     aaaaaaaaa
      aaaaaaaaa
          .....
             aaaaaaaaa

Use information that is gathered in comparisons to motivate larger shifts than 1 (e.g., here we'd like to shift |P|)


next up previous
Next: BOYER-MOORE Up: NAIVE PATTERN MATCHER Previous: More Analysis