KMP
祖国的小果abc
我是菜鸟。。创造奇迹……
展开
-
字符串匹配的KMP算法
原网址:http://kb.cnblogs.com/page/176818/字符串匹配的KMP算法作者: 阮一峰 发布时间: 2013-08-28 17:12 阅读: 49731 次 推荐: 117 原文链接 [收藏] 字符串匹配是计算机的基本任务之一。 举例来说,有一个字符串"BBC ABCDAB ABCDABCDABDE",我想转载 2015-08-31 09:25:23 · 217 阅读 · 0 评论 -
Count the string
Count the stringTime Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 22 Accepted Submission(s) : 11Problem DescriptionIt is well know转载 2015-08-08 19:03:24 · 658 阅读 · 0 评论 -
自己理解的KMP
看来KMP的next的数组(实际上只是把求解next数组代码记下来了)然后根据:移动的位数=已匹配的字符数-next数组对应的值(对应不匹配的前一个我认为)#include#include#includeusing namespace std;char str[100],text[100];int next[100];void getnext(int len) //next数原创 2015-10-10 18:13:10 · 343 阅读 · 0 评论