GATE 2009 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2009

66 questions

MCQ 661-mark 24 · 2-mark 42

Questions 36–40 of 66

Q36Dynamic Programming2 marksMCQ−0.67 if wrong
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 l(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
l(i, j) = expr1, if i,j>0 and x [i-1] = Y [j -1]
l(i, j) = expr2, if i,j>0 and x [i-1] != Y [j -1]
The values 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)?

Q37Dynamic Programming2 marksMCQ−0.67 if wrong
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 l(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?

Q38Minimum Spanning Tree2 marksMCQ−0.67 if wrong
Consider the following graph:
a b e d g c f 5 3 2 4 6 5 6 6 6 3 5 4
Which one of the following is NOT the sequence of edges added to the minimum spanning tree using Kruskal's algorithm?

Q39Shortest Path1 markMCQ−0.33 if wrong
Which of the following statement(s) is/are correct regarding Bellman-Ford shortest path algorithm?

P. Always finds a negative weighted cycle, if one exists.
Q. Finds whether any negative weighted cycle is reachable from the source.

Q40Regular Expression1 markMCQ−0.33 if wrong
Which one of the following languages over the alphabet {0,1} is described by the regular expression: (0+1)*0(0+1)*0(0+1)*?