Question DSA-STR-0068
HardWhy does Rabin–Karp have O(nm) worst-case time?
- A.
It sorts the text
- B.
Its hash takes O(m) to update
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Strings question
Why does Rabin–Karp have O(nm) worst-case time?
It sorts the text
Its hash takes O(m) to update
Sign up free to see the answer and a step-by-step explanation.
It uses recursion
Many hash collisions force character-by-character checks at many positions