string-search What
This project is an implementation of several fast exact string searching algorithms. It provides 6 executables:
bin/search0
: Brute-forcebin/search1
: Shift-andbin/search1-bit-vector
: Bit-vector version of the Shift-and algorithmbin/search2
: Knuth-Morris-Prattbin/search3
: Boyer-Moore-Horspoolbin/search4
: Rabin-Karp
Compiling
mkdir bin
cmake .
make
Running
./bin/searchX pattern-file [files ...]
Status
There is a known issue in search1
: when searching for the pattern aaaa
in
the text aaaaaaaaa
, the algorithm will find one before the start of the
file. This is probably caused by the optimizations there. I don't know if I will
ever fix this bug, since the project has been handed in now.