GATE CSE
First time here? Checkout the FAQ!
x
0 votes
73 views

The longest common subsequence of the sequences X=<A, B, C, B, D, A, B> and Y=<B, D, C, A, B, A> has length

  1. 2
  2. 3
  3. 4
  4. 5
asked in Algorithms by Veteran (76k points)   | 73 views

2 Answers

+2 votes
Best answer

4 is ans i.e. BDAB , BCAB , BCBA .

pnc

 

answered by Veteran (44.8k points)  
edited by

edit: - it would be BDAB NOT BDBA

0 votes
The LCS  of X and Y  are BCBA , BDAB, BDBA (which can be obsereved from the list they may or may not be continuous in appearance ) i.e are of length 4 hence  C is the ans
answered by Veteran (41.4k points)  


Top Users Mar 2017
  1. rude

    5156 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2732 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Vignesh Sekar

    1422 Points

  8. Akriti sood

    1386 Points

  9. Bikram

    1354 Points

  10. Sanjay Sharma

    1128 Points

Monthly Topper: Rs. 500 gift card

21,537 questions
26,871 answers
61,210 comments
23,221 users