GATE CSE
First time here? Checkout the FAQ!
x
0 votes
97 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 (77.2k points)   | 97 views

2 Answers

+2 votes
Best answer

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

pnc

 

answered by Veteran (47.4k 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 (43.5k points)  


Top Users May 2017
  1. akash.dinkar12

    3152 Points

  2. pawan kumarln

    1630 Points

  3. sh!va

    1590 Points

  4. Arjun

    1350 Points

  5. Devshree Dubey

    1246 Points

  6. Angkit

    1044 Points

  7. Debashish Deka

    1022 Points

  8. Bikram

    972 Points

  9. LeenSharma

    820 Points

  10. Prashant.

    692 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 May 22 - 28
  1. pawan kumarln

    256 Points

  2. Ahwan

    232 Points

  3. jjayantamahata

    114 Points

  4. joshi_nitish

    114 Points

  5. Arnab Bhadra

    94 Points


22,731 questions
29,061 answers
65,094 comments
27,625 users