#include <stdio.h>
#include <stdlib.h>
int BF(char S[], char T[])
{
int index=0;
int i=0, j=0;
while((S[i] != '\0') && (T[j] !='\0'))
{
if(S[i]==T[j])
{
i++;
j++;
}
else{
index++;
i=index;
j=0;
}
}
if(T[j] =='\0')
return index+1;
else return 0;
}
void GetNext(char T[],int next[])
{
int i,j,len;
next[0]=-1;
for(j=1;T[j]!='\0';j++)
{
for(len = j-1;len>=1;len--)
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载