explanation of boyer-moore algorithm
Anyone here knows any site that has good demo + source code on boyer-moore algorithm, please let me know,thanks I've found one, but it seems to fail on the test :
pattern="aba"
text="decbababaegh"
the match should occur at two pos, 5 and 7, but it fails to produce so because when it matches the 1st time, it jumps all three characters.
How do we handle if there are more than one instance of a character in the pattern, the shift value should be same, or different?
# 1 Re: explanation of boyer-moore algorithm
check out:
http://www-sr.informatik.uni-tuebingen.de/~buehler/BM/BM.html
it can find both positions 5 & 7. It's an animation program, so is kinda fun.
Cheers.