Question: Write your code in file called edit_distance.c. Use the bottom-up (iterative) method to compute the edit distance (or matching cost) between 2 strings. Requirements: 1.

Write your code in file called edit_distance.c.

Use the bottom-up (iterative) method to compute the edit distance (or matching cost) between 2 strings. Requirements:

1. in main write a loop that repeatedly reads 2 strings (from the user) and prints the distance matrix, the distance between the strings and, if part b) is implemented, the string alignment. The loop should stop when the pair -1 -1 is given as the strings. It will be able to use data from a file, by redirecting the program input. Do not explicitly read from a file. 2.The table showing the cost must show the numbers aligned exactly as shown in the sample run: 3 spaces for number display in each cell and horizontal lines for the table . (You can work on the table display before you implement the edit distance (you can print 0 in every cell).)

3.The strings can be at most 100 characters long.

4.You can structure your code however you want: use helper functions, structs,...

5.No partial credit will be given for this problem.

6.Use the iterative (bottom-up) method. You can organize and have any signature you want for your functions.

We will test your code by running it and redirecting input as shown in the sample run below. Below are some sample runs. Here is the sample run that uses file data1.txt:

gcc -o ed edit_distance.c ./ed

Write your code in file called edit_distance.c. Use the bottom-up (iterative) method

gcc -o ed edit_distance.c ./ed

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 Databases Questions!