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

2 Answers

+2 votes
Best answer

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

pnc

 

answered by Veteran (47.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 (43.9k points)  


Top Users Jun 2017
  1. Bikram

    3704 Points

  2. Hemant Parihar

    1484 Points

  3. junaid ahmad

    1432 Points

  4. Arnab Bhadra

    1408 Points

  5. Niraj Singh 2

    1311 Points

  6. Rupendra Choudhary

    1194 Points

  7. rahul sharma 5

    1132 Points

  8. Debashish Deka

    994 Points

  9. srestha

    932 Points

  10. Arjun

    930 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 Jun 19 - 25
  1. Bikram

    1960 Points

  2. Niraj Singh 2

    1306 Points

  3. junaid ahmad

    502 Points

  4. sudsho

    410 Points

  5. akankshadewangan24

    388 Points


23,355 questions
30,066 answers
67,371 comments
28,382 users