Question: Suppose we are using the Rabin - Karp algorithm to search for the first four letters of your last name ( ' barn ' )

Suppose we are using the Rabin-Karp algorithm to search for the first four letters
of your last name ('barn') in a text consisting of lowercase letters.
(a) Determine the hash value for the first four letters of your last name using the alphabet {a,b,c,...,z} where a =0, b =1, etc., using a modulus of 23. Example calcuation (26^3(a)+26^2(n)+26(m)+n) mod 23.
(b) Find an 8 character string starting with abc which leads to the maximum number of false hits when searching for the first four letters of your last name.
(c) Find an 8 character string that has 4 false hits before successfully finding the pattern consisting of the first four letters of your last name.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!