kmp 算法
摘要:
#include <stdio.h>#include <string.h>#include <stdlib.h>int next[1000];int nextval[1000];void get_next(char *str){ int i = 1 , j = 0, len; str[0] = strlen( (str + 1)); next[1] = 0; while ( i < str[0] ) { if ( j == 0 || str[i] == str[j] ) i++, j++, next[i] = j; else j = next[j]; 阅读全文
posted @ 2011-07-24 13:55 more think, more gains 阅读(224) 评论(0) 推荐(0)
浙公网安备 33010602011771号