+1 vote
in Data Structures & Algorithms II by (110k points)
Rabin Karp algorithm and naive pattern searching algorithm have the same worst case time complexity.

(a) true

(b) false

I had been asked this question by my school principal while I was bunking the class.

This is a very interesting question from Searching in portion Searching of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
 
Best answer
Correct answer is (a) true

Best explanation: The worst case time complexity of Rabin Karp algorithm is O(m*n) but it has a linear average case time complexity. So Rabin Karp and naive pattern searching algorithm have the same worst case time complexity.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...