![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP
杨明诚
明则诚矣,诚则明矣
展开
-
Number Sequence
Number Sequence Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K原创 2017-08-15 20:32:39 · 540 阅读 · 0 评论 -
Kmp算法
设主串(下文中我们称作T)为:a b a b b a b a b a d a b a b a a a b a b a a 模式串(下文中我们称作S)为:a b a b a a a b a b a a nest[i] : -1 0 0 1 2 3 1 1 2 3 4 5 三个数组我们都从1开始,到他们的长度。 当用暴力的算法时,我们会把T[1]与S[1]比较知道T[4]时不再匹原创 2017-08-16 09:58:27 · 243 阅读 · 0 评论