Rabin-Karp
← Back to Pattern Matching
A string matching algorithm that uses hashing to find pattern matches. Computes a rolling hash of text windows and compares with the pattern’s hash. O(n + m) expected time, O(nm) worst case. Efficient for multiple pattern matching.