首页 > 代码库 > Boyer-Moore algorithm

Boyer-Moore algorithm

http://www-igm.univ-mlv.fr/~lecroq/string/node14.html

Main features

  • performs the comparisons from right to left;
  • preprocessing phase in O(m+技术分享) time and space complexity;
  • searching phase in O(mn) time complexity;
  • 3n text character comparisons in the worst case when searching for a non periodic pattern;
  • O(n / m) best performance.

 

Boyer-Moore algorithm