i 0 1 2 3 4 5 6 7 8 9 10 11
a[i] a a b a a b a a b a a b
next[i] -1 0 1 0 1 2 3 4 5 6 7 8
↓
next[i]值是0或-1的忽略。
出处:http://www.cnblogs.com/yym2013/p/3586495.html
参考例题:hdu1358
参考:http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html