1
GATE CSE 2009
MCQ (Single Correct Answer)
+2
-0.6
A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences X[m] and Y[n] of lengths m and n, respectively with indexes of X and Y starting from 0.

We wish to find the length of the longest common sub-sequence (LCS) of X[m] and Y[n] as l(m,n), where an incomplete recursive definition for the function I(i,j) to compute the length of the LCS of X[m] and Y[n] is given below:
l(i,j)  = 0, if either i = 0 or j = 0
        = expr1, if i,j > 0 and X[i-1] = Y[j-1]
        = expr2, if i,j > 0 and X[i-1] ≠ Y[j-1]
The value of l(i, j) could be obtained by dynamic programming based on the correct recursive definition of l(i, j) of the form given above, using an array L[M, N], where M = m+1 and N = n + 1, such that L[i, j] = l(i, j).

Which one of the following statements would be TRUE regarding the dynamic programming solution for the recursive definition of l(i, j)?
A
All elements of L should be initialized to 0 for the values of l(i, j) to be properly computed.
B
The values of l(i,j) may be computed in a row major order or column major order of L[M, N].
C
The values of l(i, j) cannot be computed in either row major order or column major order of L[M, N].
D
L[p, q] needs to be computed before L[r, s] if either p < r or q < s.
2
GATE CSE 2009
MCQ (Single Correct Answer)
+2
-0.6
A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences X[m] and Y[n] of lengths m and n, respectively with indexes of X and Y starting from 0.

We wish to find the length of the longest common sub-sequence (LCS) of X[m] and Y[n] as l(m,n), where an incomplete recursive definition for the function I(i,j) to compute the length of the LCS of X[m] and Y[n] is given below:
l(i,j)  = 0, if either i = 0 or j = 0
        = expr1, if i,j > 0 and X[i-1] = Y[j-1]
        = expr2, if i,j > 0 and X[i-1] ≠ Y[j-1]
Which one of the following options is correct?
A
expr1 = l(i − 1, j) + 1
B
expr1 = l(i, j − 1)
C
expr2 = max( l(i − 1, j), l(i, j − 1))
D
expr2 = max( l(i − 1,j − 1),l (i, j))
3
GATE CSE 2009
MCQ (Single Correct Answer)
+1
-0.3
Let $${\pi _A}$$ be a problem that belongs to the class NP. Then which one of the following is TRUE?
A
There is no polynomial time algorithm for $${\pi _A}$$
B
If $${\pi _A}$$ can be solved deterministically in polynomial time, then P = NP
C
If $${\pi _A}$$ is NP-hard, then it is NP-complete.
D
$${\pi _A}$$ may be undecidable.
4
GATE CSE 2009
MCQ (Single Correct Answer)
+1
-0.3
Match all items in Group 1 with correct options from those given in Group 2.

Group 1

P. Regular expression
Q. Pushdown automata
R. Dataflow analysis
S. Register allocation

Group 2

1. Syntax analysis
2. Code generation
3. Lexical analysis
4. Code optimization
A
P - 4. Q - 1, R - 2, S - 3
B
P - 3, Q - 1, R - 4, S - 2
C
P - 3, Q - 4, R - 1, S - 2
D
P - 2, Q - 1, R - 4, S - 3
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12