Rabin-Karp Algorithm Multiple choice Questions and Answers (MCQs)
What is a Rabin and Karp Algorithm?
String Matching Algorithm
Shortest Path Algorithm
Minimum spanning tree Algorithm
Question 1 Explanation:
The string matching algorithm which was proposed by Rabin and Karp, generalizes to other algorithms and for two-dimensional pattern matching problems.
What is the pre-processing time of Rabin and Karp Algorithm?
Question 2 Explanation:
The for loop in the pre-processing algorithm runs for m(length of the pattern) times. Hence the pre-processing time is Theta(m).
Rabin Karp Algorithm makes use of elementary number theoretic notions.
Question 3 Explanation:
Rabin Karp Algorithm makes use of elementary theoretic number notions such as the equivalence of two numbers modulo a third number.
What is the basic formula applied in Rabin Karp Algorithm to get the computation time as Theta(m)?
Question 4 Explanation:
The pattern can be evaluated in time Theta(m) using Horner's rule:
p = P[m] + 10(P[m-1] + 10(P[m-2] +...+ 10(P+10P)...)).
What is the worst case running time of Rabin Karp Algorithm?
Question 5 Explanation:
The worst case running time of Rabin Karp Algorithm is Theta(n-m+1)m). We write Theta(n-m+1) instead of Theta(n-m) because there are n-m+1 different values that the given text takes on.
There are 5 questions to complete.