Knuth–Morris–Pratt algorithm: Difference between revisions

Content deleted Content added
Undid revision 794874321 by 191.54.251.34 (talk)
Line 354:
'''while''' pos < length(W) do
'''let''' T[pos] ← cnd
'''whileif''' cnd > -1 and W[pos] !=<> W[cnd] do'''then'''
'''let''' cnd ← T[cnd] (to increase performance)
'''while''' cnd >= 0 and W[pos] <> W[cnd] do
'''let''' cnd ← T[cnd]
'''let''' pos ← pos + 1, cnd ← cnd + 1