in reply to Re: Why Boyer-Moore, Horspool, alpha-skip et.al don't work for bit strings. (And is there an alternative that does?)
in thread Why Boyer-Moore, Horspool, alpha-skip et.al don't work for bit strings. (And is there an alternative that does?)
The point though is that instead of having a table of shifts required for a given byte, you can have a table of shifts required for the position of the rightmost mismatch.
The right mismatching what? Single bit? Group of 8 bits? Or 13 bits? 1000001 bits?
My point is that a table of single bits 0 or 1 doesn't help; but any larger than that, and you're into the "groups of aligned bits" problem I described above.
Whatever alignment you choose, byte/word/other; and whatever group of bits from the mismatched position in the haystack you use as your index, shift the needle 1-bit either way from that alignment and that group is no longer relevant.
I don't know how to better describe it; but until you've tried to implement what you are describing -- using bits; not bytes pretending to be bits -- you will not appreciate the problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why Boyer-Moore, Horspool, alpha-skip et.al don't work for bit strings. (And is there an alternative that does?)
by Anonymous Monk on Apr 06, 2015 at 00:37 UTC | |
by BrowserUk (Patriarch) on Apr 06, 2015 at 01:14 UTC | |
by Anonymous Monk on Apr 06, 2015 at 06:30 UTC | |
by Anonymous Monk on Apr 06, 2015 at 06:31 UTC |