Consider strings x and text, of length m and n, respectively, from an alphabet A consisting of d characters. (a) Modify the pseudocode of the naive string-matching algorithm to include the don’t care symbol. (b) Employ the assumptions of Problem 18 but also that x has exactly k don’t care symbols while text has none. Find the number of character-to-character comparisons made on average for otherwise random strings. (c) Show that in the limit of k = 0 your answer is closely related to that of Problem 18. (d) What is your answer in part (b) in the limit k = m?

Question
Asked Mar 4, 2020
1 views

Consider strings x and text, of length m and n, respectively, from an alphabet A consisting of d characters.

(a) Modify the pseudocode of the naive string-matching algorithm to include the don’t care symbol.

(b) Employ the assumptions of Problem 18 but also that x has exactly k don’t care symbols while text has none. Find the number of character-to-character comparisons made on average for otherwise random strings.

(c) Show that in the limit of k = 0 your answer is closely related to that of Problem 18.

(d) What is your answer in part (b) in the limit k = m?

 

Expert Answer

This question hasn't been answered yet.

Ask an expert

Check out a sample Q&A here.

The solution to your study problems

Solutions are written by subject matter experts who are available 24/7. Questions are typically answered within 1 hour.*

Get Started
*Response times may vary by subject and question.