Concept Flow - Rabin Karp String Matching
Compute pattern hash
Compute initial text window hash
For each text window
Compare pattern hash and window hash?
No→Slide window: update hash
|Yes
Check characters one by one
Match found?
No→Slide window: update hash
Yes
Report match
Repeat until end of text
The algorithm computes a hash for the pattern and for each window of text, compares hashes, and if equal, checks characters to confirm match.
