Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
问个关于kmp的问题!memmove(s+1,s,lens); //for(i=0;i<=lens;i++) // next[i]=0; i=1;next[1]=0;j=0; while(i<lens) { if(j==0||s[i]==s[j]) { ++i; ++j; next[i]=j; } else j=next[j]; } 上面这个是根据清华的严老师的那本数据结构写的kmp算法,但是用sasass是 s 0 s 0 a 1 s 1 a 2 s 3 s 4 这个是不是有点问题啊?最后一个s是4还是1?? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator