摘要: kmp算法的最难理解的是next数组的生成,next数组存储的是匹配子串数组前缀与后缀相同长度。该next数组长度为字符串+1,next[0] = -1。 例题: hdu2203 #include<iostream> #include<cstdio> #include<cstring> #inclu 阅读全文