What are the main differences between the Knuth-Morris-Pratt and Boyer-Moore search algorithms?

后端 未结 3 1305
鱼传尺愫
鱼传尺愫 2021-01-29 20:36

What are the main differences between the Knuth-Morris-Pratt search algorithm and the Boyer-Moore search algorithm?

I know KMP<

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-29 21:15

    Boyer-Moore technique match the characters from right to left, works well on long patterns. knuth moris pratt match the characters from left to right, works fast on short patterns.

提交回复
热议问题