![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP
z岁月无声
这个作者很懒,什么都没留下…
展开
-
LeetCode-28. 实现 strStr()
地址:https://leetcode-cn.com/problems/implement-strstr/ 思路:KMP算法 Code: class Solution { public: void GetNext(string str,int Next[]){ Next[0]=-1; int k=0; for(int i=1;i&...原创 2020-01-14 20:32:23 · 132 阅读 · 0 评论 -
KMP模板题
KMP模板: #include<iostream> using namespace std; const int MAX_S=1000005; int n,m; string str,st; int Next[MAX_S]; void GetNext(); int KMP(); int main() { ios::sync_with_stdio(false); while(...原创 2018-08-24 17:36:13 · 294 阅读 · 0 评论