![](https://img-blog.csdnimg.cn/20190927151117521.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
KMP
KMP
七九河开
这个作者很懒,什么都没留下…
展开
-
String Tale URAL - 1423 (KMP)
Background I want to tell you a story. Not entirely, but only the very beginning, because the ending of this story became a legend of programming—as well as its heroes. ...原创 2018-06-21 20:29:50 · 166 阅读 · 0 评论 -
从头到尾彻底理解KMP
1. 引言 本KMP原文最初写于2年多前的2011年12月,因当时初次接触KMP,思路混乱导致写也写得混乱。所以一直想找机会重新写下KMP,但苦于一直以来对KMP的理解始终不够,故才迟迟没有修改本文。 然近期因开了个算法班,班上专门讲解数据结构、面试、算法,才再次仔细回顾了这个KMP,在综合了一些网友的理解、以及算法班的两位讲师朋友曹博、邹博的理解之后,写了9张PPT,发在微博...转载 2018-10-12 21:29:57 · 224 阅读 · 0 评论 -
KMP模板
#include<iostream> #include<cstring> #include<cstdio> using namespace std; int nex[1000005]; void kmpNext(char *p) { int t = nex[0] = -1; int n =strlen(p); int j = 0; ...原创 2018-10-15 20:05:16 · 90 阅读 · 0 评论 -
拓展KMP模板
const int N = 1e6 + 10; typedef long long ll; char s1[N],s2[N]; int nex[N],extend[N]; void get_next(char s[]) { int len = strlen(s); nex[0] = len; int mx = 0,id; for(int i = 1;i <...原创 2019-02-16 10:05:58 · 99 阅读 · 0 评论