改进的KMP模式匹配算法
摘要:
1 #include<stdio.h> 2 #include<string.h> 3 int next[12],la,lb; 4 void GetNext(char T[]) 5 { 6 int j=1,k=0; 7 next[1]=0; 8 while(j<=la) 9 { 10 if(k==0||T[j]==T[k])11 { 12 ++j;13 ++k;14 if(T[k]==T[j])15 next[j]=next[k... 阅读全文
posted @ 2012-08-03 09:16 mycapple 阅读(407) 评论(0) 推荐(0)