Question DSA-STR-0018
HardHow does the Rabin–Karp algorithm compare a pattern with substrings of the text quickly?
- A.
By comparing every character every time
- B.
Using a suffix tree only
- C.
Using a rolling hash, updated in O(1) as the window slides
- D.
By sorting the text
Sign up free to see the answer and a step-by-step explanation.