![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP-字符串匹配算法
文章平均质量分 69
cjj97
这个作者很懒,什么都没留下…
展开
-
KMP模板
next数组求法连接,感觉比较详细点击打开链接 kmp函数讲解,链接点击打开链接 #include #include void GetNext(char *t,int lt) //求next数组 { int i=0;k=-1; next[0]=-1; while(i<lt) { if(k==-1||t[i]==t[k]) next[++i]=++k; else原创 2017-08-15 20:20:49 · 141 阅读 · 0 评论 -
Kmp 与 BF算法
#include #include using namespace std; int next[200]; void GetNext(char *t,int lt) //求next数组 { int i=0,k=-1; next[0]=-1; while(i<lt-1) // 根据已知的前j位推测第j+1位 { if(k==-1||t[i]==t[k]) { if(t[i原创 2017-12-04 17:53:38 · 245 阅读 · 0 评论