GATE CSE 2013
View Questions

GATE CSE

1
Which of the following is the tightest upper bound that represents the number of swaps required to sort n numbers using selection sort?
2
Which one of the following is the tightest upper bound that represents the time complexity of inserting an object in to a binary search tree of n nodes?
3
What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices?
4
The number of elements that can be stored in $$\Theta (\log n)$$ time using heap sort is
5
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.
MultiDequeue(Q){
   m = k
   while (Q is not empty and m  > 0) {
      Dequeue(Q)
      m = m - 1
   }
}
What is the worst case time complexity of a sequence of n operations on an initially empty queue?
6
Consider the following function:
int unknown(int n) {
    int i, j, k = 0;
    for (i  = n/2; i <= n; i++)
        for (j = 2; j <= n; j = j * 2)
            k = k + n/2;
    return k;
 }
The return value of the function is
7
Which of the following statements are TRUE?

1. The problem of determining whether there exists a cycle in an undirected graph is in P.

2. The problem of determining whether there exists a cycle in an undirected graph is in NP.

3. If a problem A is NP−Complete, there exists a non-deterministic polynomial time algorithm to solve A.

8
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and unit-production ( i.e., of type $$A \to \varepsilon $$ and $$A \to a$$ ) to parse a string with n tokens?
9

Consider the following two sets of LR(1) items of an LR(1) grammar.

$$\eqalign{ & X \to c.X,\,c/d\,\,\,\,\,\,\,\,X \to c.X,\$ \cr & X \to .cX,c/d\,\,\,\,\,\,\,\,X \to .cX,\$ \cr & X \to .d,c/d\,\,\,\,\,\,\,\,\,\,\,X \to .d,\$ \cr} $$

Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE?

1. Cannot be merged since look aheads are different.
2. Can be merged but will result in S-R conflict.
3. Can be merged but will result in R-R conflict.
4. Cannot be merged since goto on c will lead to two different sets.

10
The transport layer protocols used for real time multimedia, file transfer, DNS and email, respectively are
11
Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D. GATE CSE 2013 Computer Networks - Concepts of Layering Question 4 English
12
Determine the maximum length of cable (in km) for transmitting data at a rate of 500 Mbps in an Ethernet LAN with frames of size 10,000 bits. Assume the signal speed in the cable to be 2,00,000 km/s
13
In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400 and the fragment offset value is 300. The position of the datagram, the sequence numbers of the first and the last bytes of the payload, respectively are
14
Using public key cryptography, X adds a digital signature σ to message M, encrypts, and sends it to Y, where it is decrypted. Which one of the following sequences of keys is used for the operations?
15
In a $$k$$-way set associative cache, the cache is divided into $$v$$ sets, each of which consists of $$k$$ lines. The lines of a set are placed in sequence one after another. The lines in set $$s$$ are sequenced before the lines in set $$(s+1).$$ The main memory blocks are numbered $$0$$ onwards. The main memory block numbered $$j$$ must be mapped to any one of the cache lines from
16
A $$RAM$$ chip has a capacity of $$1024$$ words of $$8$$ bits each $$\left( {1K \times 8} \right).$$ The number of $$2 \times 4$$ decoders with enable line needed to construct a $$16K \times 16\,\,RAM$$ from $$1K \times 8\,\,RAM$$ is
17
Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction $$(FI),$$ Decode Instruction $$(DI),$$ Fetch Operand $$(FO),$$ Execute Instruction $$(EI)$$ and Write Operand $$(WO).$$ The stage delays for $$FI, DI, FO, EI$$ and $$WO$$ are $$5$$ $$ns,$$ $$7$$ $$ns,$$ $$10$$ $$ns,$$ $$8$$ $$ns$$ and $$6$$ $$ns$$, respectively. There are intermediate storage buffers after each stage and the delay of each buffer is $$1$$ $$ns.$$ A program consisting of $$12$$ instructions $${{\rm I}_1},{{\rm I}_2},{{\rm I}_3},......,\,\,{{\rm I}_{12}}$$ is executed in this pipelined processor. Instruction $${{\rm I}_4}$$ is the only branch instruction and its branch target is $${{\rm I}_9}$$. If the branch is taken during the execution of this program, the time (in $$ns$$) needed to complete the program is
18
Consider a hypothetical processor with an instruction of type $$LW$$ $$R1, 20(R2),$$ which during execution reads a $$32$$-bit word from memory and stores it in a $$32$$-bit register $$R1.$$ The effective address of the memory location is obtained by the addition of a constant $$20$$ and the contents of register $$R2.$$ Which of the following best reflects the addressing mode implemented by this instruction for the operand in memory?

19
Consider the following sequence of micro-operations
$$\eqalign{ & \,\,\,\,\,\,\,\,\,\,\,\,\,MBR\,\,\,\,\,\,\, \leftarrow PC \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,MAR\,\,\,\,\,\,\, \leftarrow X \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,PC\,\,\,\,\,\,\,\,\,\,\,\, \leftarrow Y \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,Memory\, \leftarrow MBR \cr} $$

Which one of the following is a possible operation performed by this sequence?

20
The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?
21

Consider the following relational schema.

Students(rollno: integer, sname: string)

Courses(courseno: integer, cname: string)

Registration(rollno: integer, courseno: integer, percent: real)

Which of the following queries are equivalent to this query in English?

"Find the distinct names of all students who score more than 90% in the course numbered 107"

(I) SELECT DISTINCT S.sname 
FROM Students as S, Registration as R 
WHERE R.rollno=S.rollno AND 
R.courseno=107 AND R.percent >90

(II) ∏snamecourseno = 107 ∧ percent > 90 (Registration ⋈ Students))

(III) { T | ∃S ∈ Students, ∃R ∈ Registration ( S.rollno=R.rollno ∧ R.courseno=107 ∧ R.percent > 90 ∧ T.sname=S.sname)}

(iv) { < SN >| ∃SR∃RP ( < SR, SN > ∈ Students ∧ ∈ Registration ∧ RP > 90)}

22
An index is clustered, if
23
Relation $$R$$ has eight attribution $$ABCDEFGH.$$ Fields of $$R$$ contain only atomic values.
$$F = \left\{ {CH \to G,\,\,A \to BC,\,B \to CFH,\,\,E \to A,\,\,F \to EG} \right\}$$ set of functional dependencies $$(FDs)$$ so that $${F^ + }$$ is exactly the set of $$FDs$$ that hold for $$R.$$

How many candidate keys does the relation $$R$$ have?

24
Relation $$R$$ has eight attribution $$ABCDEFGH.$$ Fields of $$R$$ contain only atomic values.
$$F = \left\{ {CH \to G,\,\,A \to BC,\,B \to CFH,\,\,E \to A,\,\,F \to EG} \right\}$$ set of functional dependencies $$(FDs)$$ so that $${F^ + }$$ is exactly the set of $$FDs$$ that hold for $$R.$$

The relation $$R$$ is

25
In the following truth table $$V=1$$ if and only if the input is valid. GATE CSE 2013 Digital Logic - Combinational Circuits Question 17 English

What function does the truth table represent?

26
The smallest integer that can be represented by an $$8$$-bit number in $$2's$$ complement form is
27
Which one of the following expressions does NOT represent exclusive NOR of $$x$$ and $$y?$$
28
What is the logical translation of the following statement?
"None of my friends are perfect."
29
Which one of the following is NOT logically equivalent to $$\neg \exists x\left( {\forall y\left( \alpha \right) \wedge \left( {\forall z\left( \beta \right)} \right)} \right)?$$
30
A Binary operation $$ \oplus $$ on a set of integers is defined as $$x$$ $$ \oplus $$ $$y$$ $$ = {x^2} + {y^2}$$. Which one of the following statements is TRUE about $$ \oplus $$ ?
31
Which one of the following functions is continuous at $$x = 3$$?
32
Function $$f$$ is known at the following points: GATE CSE 2013 Discrete Mathematics - Calculus Question 32 English

The value of $$\int\limits_0^3 {f\left( x \right)dx} $$ computed using the trapezoidal rule is

33
Consider an undirected random$$^ \circ $$ graph of eight vertices. The probability that there is an edge between a pair of vertices is 1/2. What is the expected number of unordered cycles of length three?
34
Which of the following statements is/are TRUE for undirected graphs?
P: Number of odd degree vertices is even.
Q: Sum of degrees of all vertices is even.
35
The line graph $$L(G)$$ of a simple graph $$G$$ is defined as follows:

$$\,\,\,\,$$There is exactly one vertex $$v(e)$$ in $$L$$(G)$$ for each edge $$e$$ in $$G$$

$$\,\,\,\,$$ For any two edges $$e$$ and $$e'$$ in $$G$$, $$L(G)$$ has an edge between $$v(e)$$ and $$v(e')$$, if and only if $$e$$ and $$e'$$

$$\,\,\,\,$$ Which of the following statements is/are TRUE?

(P) The line graph of a cycle is a cycle.
(Q) The line graph of a clique is a clique.
(R) The line graph of a planar graph is planar.
(S) The line graph of a tree is a tree.

36
Which of the following does not equal
$$\left| {\matrix{ 1 & x & {{x^2}} \cr 1 & y & {{y^2}} \cr 1 & z & {{z^2}} \cr } } \right|?$$
37
Which one of the following functions is continuous at $$x=3?$$
38
Suppose p is the number of cars per minute passing through a certain road junction between 5PM and 6PM and p has a poisson distribution with mean 3. What is the probability of observing fewer than 3 cars during any given minute in this interval?
39
A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every $$T$$ time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no $${\rm I}/O$$ operations and all arrive at time zero?
40
Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation (i.e., wait) on semaphores a, b and c; process Y executes the P operation on semaphores b, c and d; process Z executes the P operation on semaphores c, d, and a before entering the respective code segments. After completing the execution of its code segment, each process invokes the V operation (i.e., signal) on its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a deadlock-free order of invoking the P operations by the processes?
41
A shared variable x, initialized to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the processes W and X reads x from memory, increments by one, stores it to memory, and then terminates. Each of the processes Y and Z reads x from memory, decrements by two, stores it to memory, and then terminates. Each process before reading x invokes the P operation (i.e., wait) on a counting semaphore S and invokes the V operation (i.e., signal) on the semaphore S after storing x to memory. Semaphore S is initialized to two. What is the maximum possible value of x after all processes complete execution?
42
A certain computation generates two arrays a and b such that a[i]=f(i)for 0 ≤ i < n and b[i] = g (a[i] )for 0 ≤ i < n. Suppose this computation is decomposed into two concurrent processes X and Y such that X computes the array a and Y computes the array b. The processes employ two binary semaphores R and S, both initialized to zero. The array a is shared by the two processes. The structures of the processes are shown below.
Process X:
private i;
for(i = 0; i < n; i++){
 a [i] = f (i);
 Exit X (R, S);
}

Process Y:
private i;
for(i = 0; i < n; i++){
 Entry Y (R, S);
 b [i] = g (a [i] );
}
Which of the following represents the correct implementations of Exit X and Entry Y?
43
What is the return value of f (p, p), if the value of p is initialized to 5 before the call? Note that the first parameter is passed by reference, whereas the second parameter is passed by value.
int f (int &x, int c) {
    c = c - 1;
    if (c==0) return 1;
    x = x + 1;
    return f(x,c) * x;
}
44
The following figure represents access graphs of two modules $$M1$$ and $$M2.$$ The filled circles represent methods and the unfilled circles represent attributes. If method m is moved to module $$M2$$ keeping the attributes where they are, what can we say about the average cohesion and coupling between modules in the system of two modules? GATE CSE 2013 Software Engineering - Software Engineering Question 10 English
45
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $$A.$$ The characters to be replaced are supplied in array $$oldc,$$ while their respective replacement characters are supplied in array $$newc.$$ Array $$A$$ has a fixed length of five characters, while arrays $$oldc$$ and $$newc$$ contain three characters each. However, the procedure is flawed. void find_and_replace (char $$^ * A,$$ char $$^ * oldc,$$, char $$^ * newc$$)
$$\left\{ \, \right.$$ for (int $$i=0; i<5; i++$$)
for (int $$j=0; j<3; j++$$)
if ( $$A$$ [ $$i$$ ] $$==oldc$$ [ $$j$$ ] $$A$$ [ $$i$$ ]
$$=newc$$ [ $$j$$ ]; $$\left. \, \right\}$$

The procedure is tested with the following four test cases;
$$\eqalign{ & \left( 1 \right)\,\,\,oldc = ''abc'',\,\,newc\, = \,''dab'' \cr & \left( 2 \right)\,\,\,oldc\, = \,''cdc'',\,\,newc\, = \,''bed'' \cr & \left( 3 \right)\,\,\,oldc\, = \,''bca'',\,newc\, = \,''cda'' \cr & \left( 4 \right)\,\,\,oldc\, = \,''abc'',\,newc\, = \,''bac'' \cr} $$

If array $$A$$ is made to hold the string $$''abcde'',$$ which of the above four test cases will be successful is exposing the flaw in this procedure?

46
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $$A.$$ The characters to be replaced are supplied in array $$oldc,$$ while their respective replacement characters are supplied in array $$newc.$$ Array $$A$$ has a fixed length of five characters, while arrays $$oldc$$ and $$newc$$ contain three characters each. However, the procedure is flawed. void find_and_replace (char $$^ * A,$$ char $$^ * oldc,$$, char $$^ * newc$$)
$$\left\{ \, \right.$$ for (int $$i=0; i<5; i++$$)
for (int $$j=0; j<3; j++$$)
if ( $$A$$ [ $$i$$ ] $$==oldc$$ [ $$j$$ ] $$A$$ [ $$i$$ ]
$$=newc$$ [ $$j$$ ]; $$\left. \, \right\}$$

The procedure is tested with the following four test cases;
$$\eqalign{ & \left( 1 \right)\,\,\,oldc = ''abc'',\,\,newc\, = \,''dab'' \cr & \left( 2 \right)\,\,\,oldc\, = \,''cdc'',\,\,newc\, = \,''bed'' \cr & \left( 3 \right)\,\,\,oldc\, = \,''bca'',\,newc\, = \,''cda'' \cr & \left( 4 \right)\,\,\,oldc\, = \,''abc'',\,newc\, = \,''bac'' \cr} $$

The tester now tests the program on all input strings of length five consisting of characters $$'a', 'b', 'c', 'd'$$ and $$'c'$$ with duplicates allowed. If the tester carries out this testing with four test cases given above, how many test cases will be able to capture the flaw?

47
Which of the following is/are undecidable?
$$1.$$ $$G$$ is a $$CFG.$$ Is $$L\left( G \right) = \Phi ?$$
$$2.$$ $$G$$ is a $$CFG.$$ Is $$L\left( G \right) = \sum {{}^ * } ?$$
$$3.$$ $$M$$ is a Turing Machine. Is $$L(M)$$ regular?
$$4.$$ $$A$$ is a $$DFA$$ and $$N$$ is an $$NFA.$$
Is $$L(A)=L(N)?$$
48
Consider the languages $${L_1} = \phi $$ and $${L_2} = \left\{ a \right\}.$$ Which one of the following represents $${L_1}\,L_2^ * UL_1^ * ?$$
49
Consider the following languages
$${L_1} = \left\{ {{0^p}{1^q}{0^r}\left| {p,q,r \ge 0} \right.} \right\}$$
$${L_2} = \left\{ {{0^p}{1^q}{0^r}\left| {p,q,r \ge 0,p \ne r} \right.} \right\}$$

Which one of the following statements is FALSE?

50
Consider the $$DFA$$ $$A$$ given below. GATE CSE 2013 Theory of Computation - Push Down Automata and Context Free Language Question 25 English

Which of the following are FALSE?
$$1.$$ Complement of $$L(A)$$ is context - free.
$$2.$$ $$L(A)$$ $$ = \left( {{{11}^ * }0 + 0} \right)\left( {0 + 1} \right){}^ * {0^ * }\left. {{1^ * }} \right)$$
$$3.$$ For the language accepted by $$A, A$$ is the minimal $$DFA.$$
$$4.$$ $$A$$ accepts all strings over $$\left\{ {0,1} \right\}$$ of length at least $$2.$$

51
Which of the following statements is/are FALSE?
$$1.$$ For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine
$$2.$$ Turing recognizable languages are closed under union and complementation
$$3.$$ Turing decidable languages are closed under intersection and complementation
$$4.$$ Turing recognizable languages are closed under union and intersection
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