GATE 2012 CSE Computer Science and information technology
[Q1 – Q25 carry ONE mark each ]
Q1➡| Engineering Mathematics Consider the following logical inferences. I1: If it rains then the cricket match will not be played. The cricket match was played. Inference: There was no rain.
I2: 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?
i ➥ Both I1 and I2 are correct inferences
ii ➥ I1 is correct but I2 is not a correct inference
iii ➥ I1 is not correct but I2 is a correct inference
Q3➡| Programming What will be the output of the following C program segment? char inchar = 'A'; switch (inchar) { case 'A' : printf ("choice A n") ; case 'B' : printf ("choice B ") ; case 'C' : case 'D' : case 'E' : default: printf ("No Choice") ; }
Q9➡| Engineering Mathematics Consider the function f(x) = sin(x) in the interval x ∈ [π/4, 7π/4]. The number and location(s) of the local minima of this function are
Q15➡| Database Management System 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 even 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
Q17➡| Engineering Mathematics Let G be a simple undirected planar 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
Q18➡| Algorithms 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?
Q21➡| Engineering Mathematics 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
Q24➡| Theory of Computation 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 L’ also context-free? 3) If L is a regular language, then, is L’ also regular? 4) If L is a recursive language, then, is L’ also recursive?
Q25➡| Theory of Computation Given the language L ={ab,aa,baa}, which of the following strings are in L* ? 1) abaabaaabaa 2) aaaabaaaa 3) baaaaabaaaab 4) baaaaabaa
Q27➡|Database Management System 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
i ➥ a serializable schedule
ii ➥ a schedule that is not conflict serializable
iii ➥ a conflict serializable schedule
iv ➥ a schedule for which a precedence graph cannot be drawn
Q28➡| Computer Organization The bisection method is applied to compute a zero of the function f(x) = x4 – x3 – x2 – 4 in the interval [1,9]. The method converges to a solution after ______ iterations.
Q29➡| Algorithms 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?
Q32➡| Operating System 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.
This implementation
i ➥ fails as L can overflow
ii ➥ fails as L can take on a non-zero value when the lock is actually available
iii ➥ works correctly but may starve some processes
Q33➡| Engineering Mathematics 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?
Q34➡| Computer Network 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 addresses to A and B?
Q35➡| Data Structure 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
i ➥ full: (REAR+1)mod n == FRONT empty: REAR == FRONT
ii ➥ full: (REAR+1)mod n == FRONT empty: (FRONT+1) mod n == REAR
iii ➥ full: REAR == FRONT empty: (REAR+1) mod n == FRONT
iv ➥ full: (FRONT+1)mod n == REAR empty: REAR == FRONT
Q36➡| Compiler Design Consider the program given below, in a block-structured pseudo-language with lexical scoping and nesting of procedures permitted.
Consider the calling chain : Main->A1->A2->A21->A1 The correct set of activation records along with their access links is given by:
Q38➡| Engineering Mathematics 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
Q39➡|Algorithms 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
Q40➡| Algorithms 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.
Q41➡|Operating System A file system with 300 GByte 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
Q42➡| Operating System 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 main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then
Q43➡| Database Management System 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?
Q44➡| Computer Network 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 link at a speed of 108 meters per second. Assume that the link bandwidth on each link is 1Mbps. 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?
Q45➡|Computer Network 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.
Q46➡| Theory of Computation Consider the set of strings on {0,1} 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.
Q47➡|Data Structure 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.
The appropriate expression for the two boxes B1 and B2 are
Q50➡| Database Management System Common Data for Questions 50 and 51: Consider the following relations A, B, C:
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of AUB is the same as that of A. (AUB) ⋈ A.Id>40∨C.Id<15 C
Q52➡| Compiler Design Statement for Linked Answer Questions 52 and 53: For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions. S → aAbB | bAaB | ε A → S B → S
The FIRST and FOLLOW sets for the non-terminals A and B are