Write a program to read in the two strings from standard input and
print them to standard output. Also print their lengths.
Step 2: Optimal value matrix
|
Allocate and initialize a two dimension array, say opt[0..M][0..N]
to store the edit distances of the subproblems.
Step 3: Computing the optimal value matrix
|
Read Sedgewick 5.3 first.
Now, it's time to write the main recursive function.
Step 4: Computing the optimal decision matrix
|
Add a second matrix, say sol[][]. Modify the initialization and
recursive solution functions to comptue the optimal decision along
with the optimal values.
Step 5: Printing the alignment
|
Wrtie a function, say printAlignment()
to print the optimal alignment. We recommend a single while loop.
Written by
Kevin Wayne