摘要:
这题只是简单的KMP 算法。 只是有一点需要注意的就是当最后一个的大小是 len % (len - next[len])不够除的时候, 要直接判断是1, 不用继续计算。其他的就是裸的求nextView Code #include<stdio.h>#include<string.h>#define maxn 1000008int next[maxn];char sift[maxn];int n;void get_next(){ int len = strlen(sift); int i = 0, j = -1; next[0] = -1; while (i <= l 阅读全文
posted @ 2012-04-11 00:57
CY_K_YC
阅读(136)
评论(0)
推荐(0)

浙公网安备 33010602011771号