ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What is the worst case running time of the Rabin-Karp Algorithm?
Correct Answer: C — Theta((n-m+1)m)
The worst case running time is Theta((n-m+1)m). We write n-m+1 instead of n-m because there are n-m+1 different positions the pattern can start in the text.