Levenshtein distance: Difference between revisions

Content added Content deleted
No edit summary
(Fix algortihm bug for Java: Iterative space optimized (even bounded), added initialization of cost array.)
Line 2,348: Line 2,348:
int[] cost = new int[lb+1];
int[] cost = new int[lb+1];
for (int i=0; i<=lb; i+=1) {
cost[i] = i;
}

for (int i=1; i<=la; i+=1) {
for (int i=1; i<=la; i+=1) {
cost[0] = i;
cost[0] = i;