If it is mostly random, without repeated patters (for instance, most bits being 0), and long needles, B-M can potentially be several orders of magnitude faster than the brute-force approach.
On the bad data cases, B-M would just become equivalent to the brute-force algorithm. I don't think it would introduce too much overhead.
In reply to Re^9: [OT] The interesting problem of comparing (long) bit-strings.
by salva
in thread [OT] The interesting problem of comparing bit-strings.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |