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
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).
Step by Step Solution
3.52 Rating (176 Votes )
There are 3 Steps involved in it
Here is an implementation of c code for wildcard pa... View full answer
Get step-by-step solutions from verified subject matter experts
