A Fast Heuristic for Exact String Matching
arXiv:1512.03512
Abstract
Given a pattern string of length consisting of distinct characters and a query string of length , where the characters of and are drawn from an alphabet of size , the {\em exact string matching} problem consists of finding all occurrences of in . For this problem, we present a randomized heuristic that in time preprocesses to identify , a rarely occurring substring of , and then use it to find all occurrences of in efficiently. This heuristic has an expected search time of , where is at least . We also show that for a pattern string whose characters are chosen uniformly at random from an alphabet of size , is .
arXiv commentarXiv admin note: substantial text overlap with arXiv:1509.09228