KMP快速字符串匹配 (next数组优化)

#include
#include
#include
#include
#include
using namespace std;

const int dmax=100100;
char s[dmax],p[dmax];
int next[dmax];


void get_next(char *p){
	int k=-1,j=0,n=strlen(p);
	next[0]=-1;
	while (j

你可能感兴趣的:(KMP快速字符串匹配 (next数组优化))