字典翻译 问答 其它 英语翻译WriteaWindowsformapplicationthatreturnsthedifferenceoftwogivenfilesusingLevenshteindistance(editdistance).Acommonly-usedbottom-updynamicprogrammingalgorithmforcomputingtheLevenshteindistanceinvolvestheuseof
问题标题:
英语翻译WriteaWindowsformapplicationthatreturnsthedifferenceoftwogivenfilesusingLevenshteindistance(editdistance).Acommonly-usedbottom-updynamicprogrammingalgorithmforcomputingtheLevenshteindistanceinvolvestheuseof
问题描述:

英语翻译

WriteaWindowsformapplicationthatreturnsthedifferenceoftwogivenfilesusingLevenshteindistance(editdistance).

Acommonly-usedbottom-updynamicprogrammingalgorithmforcomputingtheLevenshteindistanceinvolvestheuseofan(n+1)×(m+1)matrix,wherenandmarethelengthsofthetwostrings.HereispseudocodeforafunctionLevenshteinDistancethattakestwostrings,soflengthm,andtoflengthn,andcomputestheLevenshteindistancebetweenthem:

//此处有一个名为:LevenshteinDistance的函数,省略,请翻译下面

Twoexamplesoftheresultingmatrix(theminimumstepstobetakenarehighlighted):

//此处有连个图形表格,省略,请翻译下面

Theinvariantmaintainedthroughoutthealgorithmisthatwecantransformtheinitialsegments[1..i]intot[1..j]usingaminimumofd[i,j]operations.Attheend,thebottom-rightelementofthearraycontainstheanswer.

李铁克回答:
  请写一个Windows表单(就是带有若干控件的窗口)程序,根据Levenshtein距离(编辑距离),计算出两个文件的差异.计算Levenshtein距离通常采用的自底向上动态编程算法,需要用到一个(n+1)×(m+1)的矩阵,n和m分别...
点击显示
其它推荐
热门其它推荐
  • 其它