Loading practice questions
What is the pre-processing time of the Rabin-Karp Algorithm?
Correct Answer: C — Theta(m)
Explanation:
The for loop in the pre-processing step runs m times (length of the pattern). Hence the pre-processing time is Theta(m).