2012年8月27日

找出所有和模式串匹配的字符串的起始下标

摘要: /*找出所有和模式串匹配的字符串的起始下标*/#include <iostream>using namespace std;void getNext(char *p,int *next){ int j,k; next[0]=-1; j=0; k=-1; while(j<strlen(p)-1) { if(k==-1||p[j]==p[k]) //匹配的情况下,p[j]==p[k] { j++; k++; next[j]=k; } e... 阅读全文

posted @ 2012-08-27 10:00 为梦飞翔 阅读(482) 评论(0) 推荐(0)

导航