A new method to obtain the shift-table in Boyer-Moore's string matching algorithm
Abstract
The Boyer-Moore algorithm uses two pre-computed tables for searching a string: skip, which utilizes the occurrence heuristic ofsymbols in a pattern, and shift, which utilizes the match heuristic of the pattern. Researchers have pointed out that the difficulty of understanding the computation of the shift table has hindered utilization of the algorithm in a wider range of applications. This paper describes an alternative way to compute the shift table. We believe that the new method is more intuitive and straightforward both conceptually and logically than the original method, and thus, easier to understand and to implement. Also, the new method has O(m) complexity in both required space and time for a pattern oflength m. Therefore, it preserves the high performance of the Boyer-Moore algorithm.
Department(s)
Computer Science
Document Type
Conference Proceeding
DOI
https://doi.org/10.1109/ICPR.2008.4761246
Publication Date
12-1-2008
Recommended Citation
Wang, Yang. "A new method to obtain the shift-table in Boyer-Moore’s string matching algorithm." In 2008 19th International Conference on Pattern Recognition, pp. 1-4. IEEE, 2008.
Journal Title
Proceedings - International Conference on Pattern Recognition