Abstract
Exact single pattern string matching is a fundamental problem in computer science. To date, the performance of existing string matching algorithms for very short patterns is poor. In this article, based on the most basic exact single pattern string matching algorithm-BF, we presented a serial improved algorithms named HBF by introducing the q-grams method, the loop unrolling method, and modifying the smallest processing unit from byte to integer. Experimental results indicated that HBF is obviously faster than known algorithms for very short patterns on our platform. Meanwhile, the pre-processing phase of HBF just need constant time and space, the worst and the best time complexity are linear and O(n/w), separately, which w is the number of characters involved in an integer.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have