Journal article
A simple fast hybrid pattern-matching algorithm
Journal of Discrete Algorithms, Vol.5(4), pp.682-695
2007
Abstract
The Knuth–Morris–Pratt (KMP) pattern-matching algorithm guarantees both independence from alphabet size and worst-case execution time linear in the pattern length; on the other hand, the Boyer–Moore (BM) algorithm provides near-optimal average-case and best-case behaviour, as well as executing very fast in practice. We describe a simple algorithm that employs the main ideas of KMP and BM (with a little help from Sunday) in an effort to combine these desirable features. Experiments indicate that in practice the new algorithm is among the fastest exact pattern-matching algorithms discovered to date, apparently dominant for alphabet size above 15–20.
Details
- Title
- A simple fast hybrid pattern-matching algorithm
- Authors/Creators
- F. Franěk (Author/Creator)C.G. Jennings (Author/Creator)W.F. Smyth (Author/Creator)
- Publication Details
- Journal of Discrete Algorithms, Vol.5(4), pp.682-695
- Publisher
- Elsevier
- Identifiers
- 991005545055707891
- Copyright
- © 2006 Elsevier B.V.
- Murdoch Affiliation
- Murdoch University
- Language
- English
- Resource Type
- Journal article
Metrics
34 Record Views