GATE CSE 2012
View Questions

GATE CSE

1
The worst case running time to search for an element in a balanced binary search tree with n2n elements is
2
Let W(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. Which of the following is ALWAYS TRUE?
3
A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is
4
Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijkstra’s shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex v is updated only when a strictly shorter path to v is discovered. GATE CSE 2012 Algorithms - Greedy Method Question 18 English
5
Given the language L= { ab, aa, baa }, which of the following strings are in L* ?

1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa

6
An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20.
The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of address to A and B?
7
The protocol data unit (PDU) for the application layer in the Internet stack is
8
In the IPv4 addressing format, the number of networks allowed under Class C addresses is
9
Consider a source computer (S) transmitting a file of size 106 bits to a destination computer (D) over a network of two routers (R1 and R2) and three links (L1, L2, and L3). L1 connects S to R1; L2 connects R1 to R2; and L3 connects R2 to D. Let each link be of length 100 km. Assume signals travel over each line at a speed of 108 meters per second. Assume that the link bandwidth on each link is 1 Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the total sum of transmission and propagation delays in transmitting the file from S to D?
10
Which of the following transport layer protocols is used to support electronic mail?
11
Consider an instance of TCP’s Additive Increase Multiplicative Decrease (AIMD) algorithm where the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.
12
The amount of $$ROM$$ needed to implement a $$4$$ bit multiplier is
13
A computer has a $$256$$ $$K$$ Byte, $$4$$-way set associative, write back data cache with block size of $$32$$ Bytes. The processor sends $$32$$ bit addresses to the cache controller. Each cache tag director $$y$$ entry contains, in addition to address tag, $$2$$ valid bits. $$1$$ modified bit and $$1$$ replacement bit.

The number of bit in the tag field of an address is

14
A computer has a $$256$$ $$K$$ Byte, $$4$$-way set associative, write back data cache with block size of $$32$$ Bytes. The processor sends $$32$$ bit addresses to the cache controller. Each cache tag director $$y$$ entry contains, in addition to address tag, $$2$$ valid bits. $$1$$ modified bit and $$1$$ replacement bit.

The size of the cache tag directory is

15
Register renaming is done in pipelined processors
16
The decimal value $$0.5$$ in $$IEEE$$ single precision floating point representation has
17
Let G be a weighted graph with edge weights greater than one and G' be the graph constructed by squaring the weights of edges in G. Let T and T' be the minimum spanning trees of G and G' respectively, with total weights t and t'. Which of the following statements is TRUE?
18
The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudocode below is invoked as height (root) to compute the height of a binary tree rooted at the tree pointer root.
int height (treeptr n) 
  { if (n== NULL) return -1; 
  if (n-> left == NULL) 
  if (n-> right ==NULL) return 0; 
  else return B1 ;             // Box 1 
  else {h1 = height (n -> left); 
      if (n -> right == NULL) return (1 + h1); 
      else {h2 = height (n -> right); 
          return B2 ;          // Box 2 
          } 
      } 
}
The appropriate expression for the two boxes B1 and B2 are
19
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
20
Which of the following statements are TRUE about an SQL query?

P: An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause
Q: An SQL query can contain a HAVING clause only if it has a GROUP BY clause
R: All attributes used in the GROUP BY clause must appear in the SELECT clause
S: Not all attributes used in the GROUP BY clause need to appear in the SELECT clause

21
Consider the following relations A, B and C:
A
ID Name Age
12 Arun 60
15 Shreya 24
99 Rohit 11

B
ID Name Age
15 Shreya 24
25 Hari 40
98 Rohit 20
99 Rohit 11

C
ID Phone Area
10 2200 02
99 2100 01

How many tuples does the result of the following SQL query contain?

SELECT A.Id 
FROM A 
WHERE A.Age > ALL (SELECT B.Age 
                   FROM B 
                   WHERE B.Name = 'Arun')
22
Consider the following relations A, B and C:
A
ID Name Age
12 Arun 60
15 Shreya 24
99 Rohit 11

B
ID Name Age
15 Shreya 24
25 Hari 40
98 Rohit 20
99 Rohit 11

C
ID Phone Area
10 2200 02
99 2100 01

How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A ∪ B is the same as that of A. $$(A\cup B)\bowtie _{A.Id > 40 \vee C.Id < 15} C$$

23
Suppose R1 (A, B) and R2 (C, D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in R2. If data in r1 and r2 satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
24
Consider the following transactions with data items P and Q initialized to zero:
T1 : read (P) ; 
     read (Q) ; 
     if P = 0 then Q : = Q + 1 ; 
     write (Q). 
T2 : read (Q) ; 
     read (P) 
     if Q = 0 then P : = P + 1 ; 
     write (P).
Any non-serial interleaving of T1 and T2 for concurrent execution leads to
25
Given the basic $$ER$$ and relational models, which of the following is INCORRECT?
26
Which of the following is TRUE?
27
What is the minimal form of the Karnaugh map shown below? Assume that $$X$$ denotes a don’t care term. GATE CSE 2012 Digital Logic - K Maps Question 4 English
28
What is the correct translation of the following statement into mathematical logic? "Some real numbers are rational"
29
The truth table GATE CSE 2012 Discrete Mathematics - Mathematical Logic Question 38 English

Represents the Boolean function

30
Consider a random variable X that takes values + 1 and-1 with probability 0.5 each.
The values of the cumulative distribution function F(x) at x = - 1 and + 1 are
31
Suppose a fair six-sided die is rolled once. If the value on the die is 1, 2 or 3 the die is rolled a second time. What is the probability that the sum total of values that turn up is at least 6?
32
How many onto (or subjective) functions are there form an n-element $$(n\, \ge \,2)$$ set to a 2-element set ?
33
The recurrence relation capturing the optional execution time of the Towers of Hanoi problem with $$n$$ discs is
34
Let G be a simple undirected planner graph on 10 vertices with 15 edges. If G is a connected graph, then the number of bounded faces in any embedding of G on the plane is equal to
35
Consider the function $$f\left( x \right) = \sin \left( x \right)$$ in the interval $$x \in \left[ {\pi /4,\,\,7\pi /4} \right].$$ The number and location(s) of the local minima of this function are
36
Which of the following graphs is isomorphic to GATE CSE 2012 Discrete Mathematics - Graph Theory Question 66 English
37
Let $$G$$ be a complete undirected graph on $$6$$ vertices. If vertices of $$G$$ $$\,\,\,\,$$ are labeled, then the number of distinct cycles of length $$4$$ in $$G$$ is equal to
38
Let $$A$$ be the $$2 \times 2$$ matrix with elements $${a_{11}} = {a_{12}} = {a_{21}} = + 1$$ and $${a_{22}} = - 1$$. Then the eigen values of the matrix $${A^{19}}$$ are
39
Consider the following logical inferences.
$${{\rm I}_1}:$$ If it rains then the cricket match will not be played. The cricket match was played.
Inference: there was no rain.

$${{\rm I}_2}:$$ If it rains then the cricket match will not be played. It did not rain
Inference:the cricket match was played. which of the following is TRUE?

40
Consider the virtual page reference string $$$1,2,3,2,4,1,3,2,4,1$$$
On a demand paged virtual memory system running on a computer system that has main memory size of $$3$$ page frames which are initially empty. Let $$LRU,$$ $$FIFO$$ and $$OPTIMAL$$ denote the number of page faults under the corresponding page replacement policy. Then
41
A file system with 300 G Byte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is
42
A process executes the code
fork $$\left( {\,\,\,} \right);$$
fork $$\left( {\,\,\,} \right);$$
fork $$\left( {\,\,\,} \right);$$
The total number of child processes created is
43
Consider the $$3$$ processes, $$P1,$$ $$P2$$ and $$P3$$ shown in the table.
Process Arrival Time Time Units
Required
P1 0 5
P2 1 7
P3 3 4

The completion order of the $$3$$ processes under the policies $$FCFS$$ and $$RR2$$ (round robin scheduling with $$CPU$$ quantum of $$2$$ time units) are

44
Fetch_And_Add (X, i) is an atomic Read-Modify-Write instruction that reads the value of memory location X, increments it by the value i, and returns the old value of X. It is used in the pseudocode shown below to implement a busy-wait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value corresponds to the lock being not available.
AcquireLock(L){ 
  While (Fetch_And_Add(L,1)) 
  L = 1; 
} 
Release Lock(L){ 
  L = 0; 
}
This implementation
45
Consider the following C code segment.
int a, b, c = 0;
void prtFun(void);
main( )
{ 
   static int a = 1; /* Line 1 */
   prtFun();
   a + = 1;
   prtFun();
   printf("\n %d %d ", a, b);
}
void prtFun(void)
{ 
   static int a=2;   /* Line 2 */
   int b=1;
   a+ = ++b;
   printf("\n %d %d ", a, b);
}
What output will be generated by the given code segment?
46
Consider the following C code segment.
int a, b, c = 0;
void prtFun(void);
main( )
{ 
   static int a = 1; /* Line 1 */
   prtFun();
   a + = 1;
   prtFun();
   printf("\n %d %d ", a, b);
}
void prtFun(void)
{ 
   static int a=2;   /* Line 2 */
   int b=1;
   a+ = ++b;
   printf("\n %d %d ", a, b);
}
What output will be generated by the given code segment if:
Line 1 is replaced by auto int a = 1;
Line 2 is replaced by register int a = 2;
47
What will be the output of the following C program segment?
Char inchar = 'A';
Switch ( inchar ) {
case 'A' : printf ("Choice A\ n") ;
case 'B' :
case 'C' : printf (“Choice B”) ;
case 'D' :
case 'E' :
default : printf ( " No Choice" ) ; }
48
Consider the program given below, in a block-structured pseudo-language with lexical scoping and nesting of procedures permitted.
Program main;
  Var . . .

  Procedure A1;
      Var . . .
      Call A2;
  End A1

  Procedure A2;
      Var . . .

      Procedure A21;
        Var . . .
        Call A1;
      End A21

      Call A21;
  End A2

  Call A1;
End main.
Consider the calling chain: Main $$ \to $$ A1 $$ \to $$ A2 $$ \to $$ A21 $$ \to $$ A1
The correct set of activation records along with their access links is given by
49
Consider the set of strings on $$\left\{ {0,1} \right\}$$ in which, every substring of $$3$$ symbols has at most two zeros. For example, $$001110$$ and $$011001$$ are in the language, but $$100010$$ is not. All strings of length less than $$3$$ are also in the language. A partially completed $$DFA$$ that accepts this language is shown below.

The missing arcs in the $$DFA$$ are

GATE CSE 2012 Theory of Computation - Finite Automata and Regular Language Question 51 English
50
What is the complement of the language accepted by the $$NFA$$ shown below?
Assume $$\sum { = \left\{ a \right\}\,\,} $$ and $$\varepsilon $$ is the empty string. GATE CSE 2012 Theory of Computation - Finite Automata and Regular Language Question 87 English
51
Which of the following problems are decidable?
$$1.$$ Does a given program ever produce an output?
$$2.$$ If L is a context-free language, then, is $$\overline L $$ also context-free?
$$3.$$ If L is a regular language, then, is $$\overline L $$ also regular?
$$4.$$ If L is a recursive language, then, is $$\overline L $$ also recursive?
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