Findstr.cpp運行結果:
GetNext-IndexKMP的結果:
輸入主串s:acabaabcaabaabcac
輸入模式串t:abaabcac
主串s長=17
模式串t長=8
next[0]=-1 next[1]=-1 next[2]=0 next[3]=0 next[4]=1
next[5]=-1 next[6]=0 next[7]=-1 next[8]=0
模式串在主串的位置從第10個字符開始
GetNext-IndexKMP的結果:
next[1]=0 next[2]=1 next[3]=1 next[4]=1 next[5]=2
next[6]=1 next[7]=1
模式串在主串的位置從第10個字符開始
GetNextVal-IndexKMP的結果:
next[1]=0 next[2]=1 next[3]=1 next[4]=0 next[5]=2
next[6]=1 next[7]=1
模式串在主串的位置從第10個字符開始
GetNext-IndexKMP的結果:
next[1]=0 next[2]=1 next[3]=1 next[4]=1 next[5]=2
next[6]=1 next[7]=1
模式串t在主串s中的位置從第10個字符開始
IndexBF的結果:
模式串t在主串s中的位置從第10個字符開始
標簽:
acabaabcaabaabcac
GetNext-IndexKMP
abaabcac
Findstr
上傳時間:
2013-12-25
上傳用戶:璇珠官人