2013年9月29日

【专题】KMP

摘要: 挖坑...----------------------------一 模板----------------------------const int maxn=1111111;char P[maxn];char T[maxn];int f[maxn];void getFail(char P[],int f[]){ int i=0,j=-1; int len=strlen(P); f[0]=-1; while (i f[n] ] 是最长的子串,既是是s的前缀又是s的后缀,同理1 -> f[ f[n] ] 是次短的...依次递归 while (f[n]>0){... 阅读全文

posted @ 2013-09-29 15:27 电子幼体 阅读(148) 评论(0) 推荐(0) 编辑

导航