1) Why do we add 1 on these line?
d[i-1, j] + 1, // deletion
d[i, j-1] + 1, // insertion
The line
if s[i] = t[j] then cost := 0
else cost := 1
should take into account deleted/lower word lengths, or am I missing something?
2) Also, the comments state deletion and insertion. Am I right in thinking that it's checking for deleted characters in both words (the integers j/i representing the length of words), because a lower value will represent deleted characters.
The code used is here (because it is pseudo code and I have no language specific issues, this thread is not in any language category):
http://www.iterasi.net/openviewer.aspx?sqrlitid=z0cloj7xhk-ce0f72v4cjq