void get_nextval(char T[]
{
//求模式串T的next函數值並存入數組next
j =
while ( T[j+
if (k = =
++j; ++k;
if (T[j]!=T[k]) next[j] = k;
else next[j] = next[k];
}//if
else k = next[k];
}// while
}//get_nextval
KMP算法匹配的過程動畫演示
From:http://tw.wingwit.com/Article/program/sjjg/201311/23526.html