
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The trace of the dynamic programming algorithm to compute the length of the longest common subsequence and the edit distance between two strings, s = cbda and t = bcad. It also reveals the optimum solutions for each problem.
Typology: Quizzes
1 / 1
This page cannot be seen from the preview
Don't miss anything!

CS 470 Quiz 20 Name ________________________ a. You are given strings S = cbda and T = bcad. Trace the dynamic programming algorithm to compute the length of the longest common subsequence for strings S and T. Also reconstruct all possible optimum solutions; that is, find all common subsequences of strings S and T that have this greatest length. j=0 j=1 j=2 j=3 j= i=0 0 0 0 0 0 i=1 0 0 1 1 1 i=2 0 1 1 1 1 i=3 0 1 1 1 2 i=4 0 1 1 2 2 The 4 optimum solutions are: (i) cd , (ii) bd , (iii) ca , (iv) ba. b. You are given strings S = cbda and T = bcad. Trace the dynamic programming algorithm to compute the edit distance between strings S and T (that is, the smallest number of insert, delete, and replace operations that can transform S into T). Also reconstruct all possible optimum solutions; that is, find all shortest sequences of edit operations that transform S into T. j=0 j=1 j=2 j=3 j= i=0 0 1 2 3 4 i=1 1 1 1 2 3 i=2 2 1 2 2 3 i=3 3 2 2 3 2 i=4 4 3 3 2 3 The 2 optimum solutions are: i. Insert b , [Keep c ], Replace b by a , [Keep d ], Delete a. ii. Delete c , [Keep b ], Replace d by c , [Keep a ], Insert d.