英语翻译Write a Windows form application that returns the differ

英语翻译
Write a Windows form application that returns the difference of two given files using Levenshtein distance (edit distance).
A commonly-used bottom-up dynamic programming algorithm for computing the Levenshtein distance involves the use of an (n + 1) × (m + 1) matrix,where n and m are the lengths of the two strings.Here is pseudocode for a function LevenshteinDistance that takes two strings,s of length m,and t of length n,and computes the Levenshtein distance between them:
//此处有一个名为:LevenshteinDistance 的函数,省略,请翻译下面
Two examples of the resulting matrix (the minimum steps to be taken are highlighted):
//此处有连个图形表格,省略,请翻译下面
The invariant maintained throughout the algorithm is that we can transform the initial segment s[1..i] into t[1..j] using a minimum of d[i,j] operations.At the end,the bottom-right element of the array contains the answer.
潜水有害健康 1年前 已收到2个回答 举报

junlove8428 春芽

共回答了17个问题采纳率:100% 举报

请写一个Windows表单(就是带有若干控件的窗口)程序,根据Levenshtein距离(编辑距离),计算出两个文件的差异.
计算Levenshtein距离通常采用的自底向上动态编程算法,需要用到一个(n + 1) × (m + 1) 的矩阵,n和m分别是两个字符串的长度.这里有一个函数LevenshteinDistance的伪代码,传入参数是:字符串s及其长度m、字符串t及其长度n.该函数计算两者的Levenshtein距离.
以下是得到的矩阵的两个示例,高亮突出部分是需要经过的最少步骤.
这个算法中,有一点自始至终保持不变:我们最少只需d[i,j]步操作即可以把(任意)初始的字符段s[1..i] 变换为t[1..j].当算法执行结束后,数组右下方的元素就是最终结果.

1年前

5

lxsky85 幼苗

共回答了42个问题 举报

写一个窗口的申请表,返回给定的差异文件使用Levenshtein两个距离(编辑距离)。

一个常用的动态规划算法的计算自下而上的Levenshtein距离包括使用一个(n + 1)×(m + 1)的矩阵,氮和m是两个字符串的长度。这里是一个功能LevenshteinDistance pseudocode带两个字符串的长度,和t的长度,计算了Levenshtein之间的距离。...

1年前

0
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.022 s. - webmaster@yulucn.com