3 ms·
IMO the Boyer-Moore string searching algorithm is way more elegant. Average case performance of O(n/m)?!? That means that the longer the string you're searchi
by mightybyte 12y ago
IMO the Boyer-Moore string searching algorithm is way more elegant. Average case performance of O(n/m)?!? That means that the longer the string you're searching for the faster you can find it! It obviously makes perfect logical sense once you think about it, but when I first heard about the algorithm it seemed magical.
- pedrocr 12y agoWikipedia says Boyer Moore is O(n+m) which is the same as this algorithm. https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm#Performance https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algo...
- mightybyte 12y agoThat's worst case complexity. It's the average case where Boyer Moore wins over KMP.