2 ms·
If you think Boyer-Moore is trippy, try to understand the partial match lookup table creation algorithm in Knuth-Morris-Pratt: http://en.wikipedia.org/wiki/Knut
by Daishiman 16y ago
If you think Boyer-Moore is trippy, try to understand the partial match lookup table creation algorithm in Knuth-Morris-Pratt: http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm#.22Partial_match.22_table_.28also_known_as_.22failure_function.22.29 http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pr...
- mhansen 16y agoThey're about the same amount of trippiness. Boyer-Moore makes the same kind of jump table, except Boyer-Moore starts comparing at the end of the search string.
- jacquesm 16y agolinked from that wikipedia page, an applet showing them side-by-side, you will need java, and you have to supply your own test strings. http://www.ics.uci.edu/~goodrich/dsa/11strings/demos/pattern/ http://www.ics.uci.edu/~goodrich/dsa/11strings/demos/pattern...