Question: Edit distance and alignment for full string matching use C(not C++ or Java) Write a C code to compute the edit distance (or matching cost)


Edit distance and alignment for full string matching use C(not C++ or Java) Write a C code 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 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 in a easily readable form (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 O irn every 3. The strings can be at most 100 characters long. 4. You can structure your code however you want: use helper functions, structs,.. 5. The typical implementation for the edit distance is iterative (buttom-up). (A memoized implementation is also fine.) Below is some sample run. In addition to the alignment it also shows the cost for each pair ("." means O and "x" means 1). Edit distance and alignment for full string matching use C(not C++ or Java) Write a C code 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 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 in a easily readable form (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 O irn every 3. The strings can be at most 100 characters long. 4. You can structure your code however you want: use helper functions, structs,.. 5. The typical implementation for the edit distance is iterative (buttom-up). (A memoized implementation is also fine.) Below is some sample run. In addition to the alignment it also shows the cost for each pair ("." means O and "x" means 1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
