Rabin–Karp algorithm: Difference between revisions

Content deleted Content added
Dcoetzee (talk | contribs)
Line 28:
'''1''' '''function''' RabinKarp(''string'' s[1..n], ''string'' sub[1..m])
'''2''' hsub := hash(sub[1..m])
'''3''' hs := hash(s[1..mn])
'''4''' '''for''' i '''from''' 1 '''to''' n
'''5''' '''if''' hs = hsub