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

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

edited

edit: - it would be BDAB NOT BDBA

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