Ray's playground

 

2010年9月21日

Data Structures(Chapter 3 of The Algorithm Design Manual)

摘要: Rabin–Karp string search algorithmfunction RabinKarp(string s[1..n], string sub[1..m])hsub := hash(sub[1..m]); hs := hash(s[1..m])for i from 1 to n-m+1if hs = hsubif s[i..i+m-1] = subreturn ihs ... 阅读全文

posted @ 2010-09-21 12:56 Ray Z 阅读(2060) 评论(0) 推荐(0) 编辑

导航