Изменения
→Псевдокод
'''int''' j = t[0] = -1
'''while''' i < x.size
'''while''' j > -1 '''and''' x[i] != <tex>\neq</tex> x[j]
j = t[j]
i++
'''int''' j = 0
'''int''' k = 0
'''while''' j <= tex>\leqslant</tex> y.size - x.size
'''while''' i < x.size '''and''' x[i] == y[i + j]
++i
'''if''' i <tex>\geqslant</tex>= x.size
'''while''' k < l '''and''' x[k] == y[j + k]
++k
'''if''' k <tex>\geqslant</tex>= l
'''OUTPUT'''(j)
j += i - t[i]
k = max(0, k - 1)
'''else'''
'''if''' t[i] <= tex>\leqslant</tex> l
k = max(0, t[i])
i = l