Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

Students also viewed these Databases questions