UGC NET CS 2018Data Structures and Algorithms › Design TechniquesVerified
UGC NET CS 2018 PYQ: Consider two sequences $X$ and $Y$ : $X=<0, 1, 2, 1, 3, 0, 1>$ $Y=<1, 3, 2, 0, 1, 0>$ The length of longest…
Consider two sequences $X$ and $Y$ :
$X=<0, 1, 2, 1, 3, 0, 1>$
$Y=<1, 3, 2, 0, 1, 0>$
The length of longest common subsequence between $X$ and $Y$ is
- A2
- B3
- C4Correct answer
- D5
Answer
(C) 4
Approach
Fill the LCS dynamic-programming table, or exhibit a common subsequence of the maximal length.
Reviewed by UGC IQ Editorial Team.