Similarity(X,Y):
For i = 0,...,m: SIM[i,0] = ig
For j = 1,...,n: SIM[0,j] = jg
For i = 1,...,m:
For j = 1,...,n:
SIM[i,j] = max(
SIM[i-1,j-1] + s(X[i],Y[j]),
SIM[i-1,j]+g,
SIM[i,j-1]+g
)
EndFor
EndFor
Return SIM[m,n]
wesam.teto.9 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.