Question: The goal is to write a well-structured and well-documented program to compute edit distance in The edit distance d(x,y) of two strings of text, x[1..m]


The goal is to write a well-structured and well-documented program to compute edit distance in The edit distance d(x,y) of two strings of text, x[1..m] and y[1..n, is defined to be the min imum possible cost of a sequence of transformation operations (defined below) that transforms string x [1..m] into string y[1..n]. To define the effect of the transformation operations, we use an auxiliary string z[1.s] that holds the intermediate results. At the beginning of the transforma- tion sequence, s-m and zLs] = x[1.m] (i.e., we start with string x[1.mj). At the end of the transformation sequence, we should have s n and z[1..s]-y[1..n] (i.e., our goal is to transform into string y[1..n). Throughout the transformation, we maintain the current length s of string z, as well as a cursor position i, i.e., an index into string z. The invariant 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
