Question: Longest common subsequence of three strings. We are given three strings a-(a, a2,a!), b = (h, b2. . . . , b,n), and c =

 Longest common subsequence of three strings. We are given three strings

Longest common subsequence of three strings. We are given three strings a-(a, a2,a!), b = (h, b2. . . . , b,n), and c = (ci, C2, . . . , G.) Find the maximum length of a common subsequence of a, b, and c (i.e., the number of characters in a longest string that is the substring of a, b and c) We define subproblems as follows. For i = 0, . . . ,1, OPT(i, j, k) denote the maximum length of a subsequence of the three strings (a1, .. , ai), (bi,....bj), and c(.,k) Then the original problem is to find OPT(l, m, n). Note that if any of the words has zero letters, then any common subsequence has 0 length. Consequently, OPT(0,j,k) = 0, OPT(i. 0, k) = 0, and OPT(i. 3,0) = 0 for all i, j, k J = 0, . . . , m, and k = 0, . . . , n, let (a) Find a recurrence relation for OPT(i, j, k), i, j, k2 1; justify your answer (b) Provide pseudocode for a DP algorithm that returns OPT(e, m, n) Longest common subsequence of three strings. We are given three strings a-(a, a2,a!), b = (h, b2. . . . , b,n), and c = (ci, C2, . . . , G.) Find the maximum length of a common subsequence of a, b, and c (i.e., the number of characters in a longest string that is the substring of a, b and c) We define subproblems as follows. For i = 0, . . . ,1, OPT(i, j, k) denote the maximum length of a subsequence of the three strings (a1, .. , ai), (bi,....bj), and c(.,k) Then the original problem is to find OPT(l, m, n). Note that if any of the words has zero letters, then any common subsequence has 0 length. Consequently, OPT(0,j,k) = 0, OPT(i. 0, k) = 0, and OPT(i. 3,0) = 0 for all i, j, k J = 0, . . . , m, and k = 0, . . . , n, let (a) Find a recurrence relation for OPT(i, j, k), i, j, k2 1; justify your answer (b) Provide pseudocode for a DP algorithm that returns OPT(e, m, n)

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!