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

2 Answers

+2 votes
Best answer

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

pnc

 

answered by Veteran (48.5k 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 (44.5k points)  


Top Users Aug 2017
  1. Bikram

    4902 Points

  2. ABKUNDAN

    4704 Points

  3. akash.dinkar12

    3480 Points

  4. rahul sharma 5

    3158 Points

  5. manu00x

    3012 Points

  6. makhdoom ghaya

    2480 Points

  7. just_bhavana

    2388 Points

  8. stblue

    2138 Points

  9. Tesla!

    2060 Points

  10. joshi_nitish

    1758 Points


25,014 questions
32,139 answers
74,824 comments
30,185 users