
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 · 169 阅读 · 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 · 367 阅读 · 0 评论