Execution | |
---|---|
Experiment
My initial conditions was:- Word length: from 100 to 1000
- Pattern length: from 2 to 11
- Repetitions: 30
I made all the posible conditions between these values, iterating the pattern length through each word length, and also running each combination 30 times.
Results
Knuth-Morris-Pratt | |
---|---|
Time | Comparisons |
Boyer-Moore | |
Time | Comparisons |
I wrote these codes after understanding the following examples:
- http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.htm
- http://www-igm.univ-mlv.fr/~lecroq/string/node8.html
- http://www-igm.univ-mlv.fr/~lecroq/string/node14.html
Yo hubiera esperado un preprocesamiento explícito en KMP y algunas conclusiones, pero está bien esta vez. 5+5.
ResponderEliminar