Question: Problem 6 . ( Compute Edit Distance ) Write a program called EditDistance.java that reads strings x and y from standard input and computes the

Problem 6.(Compute Edit Distance) Write a program called EditDistance.java that reads strings x and y from standard input and computes the edit-distance matrix opt as described above. The program should output x, y, the dimensions (number of rows and columns) of opt, and opt itself, using the following format:
The first and second lines should contain the strings x and y.
The third line should contain the dimensions of the opt matrix, separated by a space.
The following lines should contain the rows of the opt matrix, each ending in a newline character. Write the elements of the matrix using stdio.writef() with "%3d " as the format string for elements not in the last column and "%3d
" as the format string for the last-column elements. 0 A|
1 A|
2 C |
3 A |
4 G |
5 T |
6T|9875335687 A |11976423468 C |131197531349 C |141210864212
7810121315161820 6665759788
810111314161868911121416467911121454579101264457810

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!