Longest common substring: Difference between revisions

Content deleted Content added
Ernstkm (talk | contribs)
m Algorithms: remove a redundant link to the "Dynamic programming" programming article (in two sentences close to each other)
Maybe I am only misunderstanding the current notation (S[i-z+ 1..i]), for me it indicates to get all character S[i-z+1]..S[i-z+i]. In the example S_1..i:=abb, T_1..j:=b at i==2, j==1 one would write S[2]==T[1] :-> 1>z :-> z<- 1 :-> ret <- {S[2-1+1]S[2-1+2]} == {bb}. S[(i-z)..i] produces exactly {b}.
Tags: Visual edit Mobile edit Mobile web edit
Line 47:
'''if''' L[i, j] > z
z := L[i, j]
ret := {S[(i − z + 1)..i]}
'''else''' '''if''' L[i, j] = z
ret := ret ∪ {S[(i − z + 1)..i]}
'''else'''
L[i, j] := 0