Consider the substring pattern matching problem for a length-m pattern, P, and a length-n text, T, where

Question:

Consider the substring pattern matching problem for a length-m pattern, P, and a length-n text, T, where one of the characters in P is a symbol, “?,” which is not in the alphabet for the text. This symbol, “?,” is a wild-card character, which matches with any character of the alphabet for the text. The pattern, P, contains exactly one “?” symbol. Show how to modify the Karp-Rabin matching algorithm for this single-pattern instance of the lexicon matching problem so that the expected running time of the resulting algorithm is O(n + m).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Algorithm Design And Applications

ISBN: 9781118335918

1st Edition

Authors: Michael T. Goodrich, Roberto Tamassia

Question Posted: