Tuesday, November 6, 2012

String Matching with Hash

Pretty clever algorithm that illustrates doing this with hash:


Rabin-Karp
http://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm

But worse case scenario, not likely to happen, is that every hash collides and then you have a quadratic time.


No comments:

Post a Comment