Content deleted Content added
Ryan Reich (talk | contribs) |
Ryan Reich (talk | contribs) |
||
Line 49:
# If <math>m + i = l</math>, then we exit; there is no match. Otherwise, compare <math>P[i]</math> versus <math>S[m + i]</math>. At this point we have already matched <math>i</math> previous characters.
#* If they are equal, set <math>i = i + 1</math>. If <math>i = n</math> then we have found a full match; terminate the algorithm and return <math>m</math> as the start of the match.
#* If they are unequal, let <math>e = T[i - 1]</math> be the entry in the "partial match" table described below at position <math>i - 1</math>. Set <math>m = m + i - e</math> and if <math>i > 0</math>, set <math>i = e</math>.
# Return to step 2.
|