Skip to content

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

  1. A
    2
  2. B
    3
  3. C
    4
    Correct answer
  4. D
    5

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.