作业帮 > 综合 > 作业

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

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/09/30 14:16:01
英语翻译
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.
英语翻译Write a Windows form application that returns the differ
请写一个Windows表单(就是带有若干控件的窗口)程序,根据Levenshtein距离(编辑距离),计算出两个文件的差异.
计算Levenshtein距离通常采用的自底向上动态编程算法,需要用到一个(n + 1) × (m + 1) 的矩阵,n和m分别是两个字符串的长度.这里有一个函数LevenshteinDistance的伪代码,传入参数是:字符串s及其长度m、字符串t及其长度n.该函数计算两者的Levenshtein距离.
以下是得到的矩阵的两个示例,高亮突出部分是需要经过的最少步骤.
这个算法中,有一点自始至终保持不变:我们最少只需d[i,j]步操作即可以把(任意)初始的字符段s[1..i] 变换为t[1..j].当算法执行结束后,数组右下方的元素就是最终结果.