Talk:Levenshtein distance: Difference between revisions

Content added Content deleted
(→‎Changed definition: new section)
(→‎Java: new section)
Line 117: Line 117:


Perhaps this is worth doing a new task for? I'm not sure... --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 13:56, 15 September 2015 (UTC)
Perhaps this is worth doing a new task for? I'm not sure... --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 13:56, 15 September 2015 (UTC)

== Java ==

The Java Iterative space optimized (even bounded) version translated from Python was missing the initialization of the cost array. Implicitly done in Python, but missing for Java. This results in subtle bugs for a subset of strings. One such example being ["abcdefgh", "defghabc"] with the correct answer being 6 and the previously translated version here returning 5. I updated the source code with the correct initialization, (i.e. cost[i] = I;). --[[User:Caislen|Caislen]] ([[User talk:Caislen|talk]]) 20:41, 16 November 2020 (UTC)