KMP算法--c语言源代码

KMP算法


/**
 * name:KMP 
 * time:2012-11-22
 * 字符串快速匹配 
 */ 
#include
#include
typedef struct seqstring{
	char string[100];
	int length;
}seqstring;

void getnext(seqstring p,int next[]){
	int i,j;
	next[0]=-1;//next[0]放上-1 
	i=0;//指向字符串每个字符的指针 
	j=-1;
	while(i


你可能感兴趣的:(KMP算法--c语言源代码)