InterviewSolution
Saved Bookmarks
| 1. |
Rabin Karp algorithm and naive pattern searching algorithm have the same worst case time complexity.(a) true(b) falseI 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 |
|
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. |
|