in reply to Re: [OT] The interesting problem of comparing (long) bit-strings.
in thread [OT] The interesting problem of comparing bit-strings.
Alright. Here's a demo of alpha skip search on bitstrings. The needle size is fixed, but it should be trivial to follow this with a longer compare. A possibility exists that some off-by-one errors have crept in. If that's the case, just deduct from my paycheck. :-)
Alpha skip is quadratic in the worst case and probably not the best choice when nasty matches are expected. Anyway, I'm curious how this might hold up against the optimized brute-force routines.
Note: to change the needle size, just edit the M and logM values. (Compile with -fno-strict-aliasing, or fix the type-punning).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: [OT] The interesting problem of comparing (long) bit-strings. (Doesn't work!)
by BrowserUk (Patriarch) on Mar 29, 2015 at 16:29 UTC | |
Re^3: [OT] The interesting problem of comparing (long) bit-strings.
by BrowserUk (Patriarch) on Mar 29, 2015 at 09:38 UTC | |
by oiskuu (Hermit) on Mar 29, 2015 at 10:32 UTC |