Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 5 (100 pts) - edit distance and alignment for full string matching Write your code in file called edit distance.c a) (50 points) Compute
Task 5 (100 pts) - edit distance and alignment for full string matching Write your code in file called edit distance.c a) (50 points) 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 g as the strings. It will be able to use data from a file, by redirecting the program iuput. Do not explicilly read from a ile 2. The table showing the cost must show the numbers aligned in a easily readable form (exactly as shown in the sample un: 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 part a). 6. Note that part b) below is graded separately. The recovering and printing the alignment is graded separate and is 50 points. Everything else is the other 50 points. b) (50 points) Recover and show the string alignment and the cost per aligned/matched pair. Your solution can be either recursive or iterative. Hint: Remember that the alignment can be longer than the longest string! For example the best alignment between strings: abcdefghij k cdxyefgh is abc defghjk cXYZdefgh This alignment has cost
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started