December2015 cs Q17

0. Given two sequences X and Y : X = < a, b, c, b, d, a, b > Y = < b, d, c, a, b, a > . The longest common subsequence of X and Y is :

  • Option : D
  • Explanation :
    A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.
    A sequence G is said to be a common subsequence of X and Y, if Z is a subsequence of both X and Y.
    Here X = <a, b, c, b, d, a, >, the sequences <b,c,a>, <c,a,b>, <b,c,b,a> are subsequences of X.
    Given a second sequence of symbols Y = <b, d, c, a, b, a>, then <b,c,a>, <c,a,b>, <b,c,b,a> are common subsequences to both X and Y.
    However, the longest common subsequence of X and Y is <b,c,b,a>

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *