GATE 2014 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2014 (Session 2)

65 questions

MCQ 42 · NAT 231-mark 30 · 2-mark 35

Questions 46–50 of 65

Q46Regular Language2 marksMCQ−0.67 if wrong
Let L1={w∈{0,1}∗∣wL_{1}=\{w \in \{0,1\}*|w has at least as many occurrences of (110)'s as (011)'s}.
Let L2={w∈{0,1}∗∣wL_{2}=\{w \in \{0,1\}*|w has at least as many occurrence of (000)'s as (111)'s}.

Which one of the following is TRUE?

Q47Dynamic Programming2 marksNAT
Consider two strings A="qpqrr" and B="pqprqrp". Let x be the length of the longest common subsequence (not necessarily contiguous) between A and B and let y be the number of such longest common subsequences between A and B. Then x + 10y = ___.

Q48Greedy Technique2 marksNAT
Suppose P, Q, R, S, T are sorted sequences having lengths 20, 24, 30, 35, 50 respectively. They are to be merged into a single sequence by merging together two sequences at a time. The number of comparisons that will be needed in the worst case by the optimal algorithm for doing this is ____.

Q49Binary Tree2 marksNAT
Consider the expression tree shown. Each leaf represents a numerical value, which can either be 0 or 1. Over all possible choices of the values at the leaves, the maximum possible value of the expression represented by the tree is ___.
0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1

Q50Function2 marksNAT
Consider the following function
 double f (double x) {
if ( abs (x*x - 3) < 0.01) return x;
else return f (x / 2 + 1.5/x);
} 
Give a value q (to 2 decimals) such that f(q) will return q:______