Dynamic Programming Question. Make the table for finding a LCS (Longest Common Subsequence) of the strings...

70.2K

Verified Solution

Question

Programming

Dynamic Programming Question. Make the table for finding a LCS(Longest Common Subsequence) of the strings SLWOVNNDK andALWGQVNBKB. You need to Show the traceback for the LCS.

Answer & Explanation Solved by verified expert
4.0 Ratings (638 Votes)
here string LWVNK is the LCSThe longest subsequence common to R GAC andC AGCAT will be found Because the LCSfunction uses a zeroth element it is convenient to define zeroprefixes that are empty for these sequences R0 and C0 All the prefixes are placed ina table with C in the first row making it a column header and Rin the first column making it a row headerLCS StringsAGCATGACThis table is used to store the LCS sequence for each step ofthe calculation The second column and second row have been filledin with because when an empty sequence is compared with anonempty sequence the longest common subsequence is always anempty sequenceLCSR1 C1 isdetermined by comparing the first elements in each sequence G andA are not the same so this LCS gets using the second propertythe longest of the two sequencesLCSR1 C0 andLCSR0 C1According to the table both of these are empty soLCSR1 C1 isalso empty as shown in the table below The arrows indicate thatthe sequence comes from both the cell aboveLCSR0 C1 andthe cell on the left LCSR1C0LCSR1 C2 isdetermined by comparing G and G They match so G is appended tothe upper left sequence LCSR0C1 which is giving G which isGFor LCSR1C3 G and C do not    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students