Diego Saraiva (4) [Avatar] Offline
#1
I found a mistake on listing 6.6: Recursively calculating the Levenshtein distance.

The last term of the following expression test if last characters of the strings match:

lev(m-1,n-1) + (a[m-1] == b[n-1])

But, if the last characters of the strings don't match, the cost of them is 1. So, I think that correct expression is:

lev(m-1,n-1) + (a[m-1] != b[n-1])
Ivan Cukic (94) [Avatar] Offline
#2
Hi Diego,

Thanks for the fix!