摘要: 介绍一种高效的KMP算法:代码可以直接运行#include #include using namespace std;void preKmp(char* s,int len,int* next){ int i=0,j=-1; next[0]=-1; while(i-1 && s[i]!=s[j]) j=next[j]; i++; j++; if(s[i]==s[j]) next[i]=next[j]; else next[i]=j; }}int KM... 阅读全文
posted @ 2014-03-12 10:55 qiaozhe 阅读(110) 评论(0) 推荐(0) 编辑