Friday, 12 June 2015

Q37,paper 3,d13. The longest common subsequence of the sequences X = and Y = has length



(A) 2
 (B) 3
(C) 4
 (D)5

Answer C.
Explanation 
let a string   ACT T GCG

ACT,AT T C,T,ACT TGC
are all subsequences.
Whereas T T A
is not a subequence
A common subequence of two strings is a subsequence that appears in
both strings. A longest common subsequence is a common subsequence
of maximum length. In our case
X=<A, B, C, B, D, A,
Y = <B, D, C, A, B, A>

X= BCBXA
Y=BXCXBA

String BCBA is the common longest subsequence.
 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.