Content deleted Content added
m Variable i renamed to k (for next edit) |
Variable m (beginning of current match in S) changed to j = m + k (current position in S) |
||
Line 134:
'''define variables''':
an integer,
an integer, k ← 0 (the position of the current character in W)
an array of integers, T (the table, computed elsewhere)
Line 140:
'''let''' nP ← 0
'''while'''
'''if''' W[k] = S[
'''let''' j ← j + 1
'''let''' k ← k + 1
'''if''' k = length(W) '''then'''
(occurrence found, if only first occurrence is needed, m may be returned at this point)
'''let''' P[nP] ←
'''let'''
'''else'''
'''let''' k ← k + 1
'''else'''
'''
'''
'''let'''
===Efficiency of the search algorithm===
|