Knuth–Morris–Pratt algorithm: Difference between revisions

Content deleted Content added
There does not exist the third branch.
Line 144:
(occurrence found, we may return m or store/use m and prepare for next search)
'''return''' m
'''let''' m ← m + i - T[i], i ← T[i] (T[length(W)] can't be -1)
'''else'''
'''if''' T[i] > -1 '''then'''