GATE Computer Science & IT 2013 — GATE 2013 · CS

CS · 65 of 65 questions publicly available

Sections: General Aptitude, Computer Science & IT

Subject marks
Subject1 mark questions2 mark questionsTotal marks
General Aptitude5515
Computer Science253085

Question 1 · 1 mark Q3700

A binary operation ⊕\oplus on a set of integers is defined as x⊕y=x2+y2x \oplus y = x^{2}+y^{2} . Which one of the following statements is TRUE about ⊕\oplus?

  1. A.

    Commutative but not associative

  2. B.

    Both commutative and associative

  3. C.

    Associative but not commutative

  4. D.

    Neither commutative nor associative

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 2 · 1 mark Q3701

Suppose pp is the number of cars per minute passing through a certain road junction between 5 PM and 6 PM, and pp has a Poisson distribution with mean 3. What is the probability of observing fewer than 3 cars during any given minute in this interval?

  1. A.

    8/(2e3)8/(2e^3)

  2. B.

    9/(2e3)9/(2e^3)

  3. C.

    17/(2e3)17/(2e^3)

  4. D.

    26/(2e3)26/(2e^3)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 3 · 1 mark Q3702

Which one of the following does NOT equal ∣1xx21yy21zz2∣?\begin{vmatrix} 1 & x & x^{2}\\ 1& y & y^{2}\\ 1 & z & z^{2} \end{vmatrix} \quad ?

  1. A. image.png

  2. B. image.png

  3. C. image.png

  4. D. image.png

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 4 · 1 mark Q3703

The smallest integer that can be represented by an 8-bit number in 2’s complement form is

  1. A.

    -256

  2. B.

    -128

  3. C.

    -127

  4. D.

    0

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 5 · 1 mark Q3704

In the following truth table, V = 1 if and only if the input is valid.

What function does the truth table represent?

  1. A.

    Priority encoder

  2. B.

    Decoder

  3. C.

    Multiplexer

  4. D.

    Demultiplexer

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 6 · 2 marks Q3705

Which one of the following is the tightest upper bound that represents the number of swaps required to sort nn numbers using selection sort?

  1. A.

    O(log n)O(log \ n)

  2. B.

    O(n)O(n)

  3. C.

    O(n log n)O(n \ log \ n)

  4. D.

    O(n2)O(n^2)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 7 · 2 marks Q3706

Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of nn nodes?

  1. A.

    O(1)O(1)

  2. B.

    O(log n)O(log \ n)

  3. C.

    O(n)O(n)

  4. D.

    O(n log n)O(n \ log \ n)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 8 · 2 marks Q3707

Consider the languages L1L_1 = Φ and L2L_2 = {a }. Which one of the following represents L1L2∗∪L1∗L_1 L_2^* \cup L_1^* ?

  1. A.

    є{є}

  2. B.

    ΦΦ

  3. C.

    a∗a^*

  4. D.

    {є,a}\{є, a\}

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 9 · 2 marks Q3708

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 → є and A → a) to parse a string with nn tokens?

  1. A.

    n/2n/2

  2. B.

    n−1n-1

  3. C.

    2n−12n-1

  4. D.

    2n2^n

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 10 · 2 marks Q1908

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 I/O operations and all arrive at time zero?

  1. A.

    This algorithm is equivalent to the first-come-first-serve algorithm

  2. B.

    This algorithm is equivalent to the round-robin algorithm.

  3. C.

    This algorithm is equivalent to the shortest-job-first algorithm.

  4. D.

     This algorithm is equivalent to the shortest-remaining-time-first algorithm

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 11 · 1 mark Q3710

Match the problem domains in GROUP I with the solution technologies in GROUP II.

          GROUP I                                                                             GROUP II
    (P) Service oriented computing                                    (1) Interoperability
    (Q) Heterogeneous communicating systems              (2) BPMN
    (R) Information representation                                     (3) Publish-find-bind
    (S) Process description                                                (4) XML

  1. A.

    P-1, Q-2, R-3, S-4

  2. B.

    P-3, Q-4, R-2, S-1

  3. C.

    P-3, Q-1, R-4, S-2

  4. D.

    P-4, Q-3, R-2, S-1

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 12 · 1 mark Q3711

The transport layer protocols used for real time multimedia, file transfer, DNS and email, respectively are

  1. A.

    TCP, UDP, UDP and TCP

  2. B.

    UDP, TCP, TCP and UDP

  3. C.

    UDP, TCP, UDP and TCP

  4. D.

    TCP, UDP, TCP and UDP

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 13 · 1 mark Q12208

Using public key cryptography, X adds a digital signature σ to a message M, encrypts (M,σ) and sends it to Y, where it is decrypted. Which one of the following sequence of keys is used for operations?

  1. A.

    Encryption : X’s private key followed by Y’s private key. Decryption : X’s public key followed by Y’s public key.

  2. B.

    Encryption : X’s private key followed by Y’s public key; Decryption : X’s public key followed by Y’s private key

  3. C.

    Encryption : X’s private key followed by Y’s public key; Decryption : Y’s private key followed by X’s public key.

  4. D.

    Encryption : X’s public key followed by Y’s private key; Decryption : Y’s public key followed by X’s private key.

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 14 · 1 mark Q3713

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.

  1. A.

    Network layer – 4 times and Data link layer – 4 times

  2. B.

    Network layer – 4 times and Data link layer – 3 times

  3. C.

    Network layer – 4 times and Data link layer – 6 times

  4. D.

    Network layer – 2 times and Data link layer – 6 times

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 15 · 1 mark Q2076

An index is clustered, if

  1. A.

    it is on a set of fields that form a candidate key

  2. B.

    it is on a set of fields that include the primary key

  3. C.

    the data records of the file are organized in the same order as the data entries of the index

  4. D.

    the data records of the file are organized not in the same order as the data entries of the index

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 16 · 1 mark Q2006

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?

  1. A.

    X: P(a)P(b)P(c) Y: P(b)P(c)P(d) Z: P(c)P(d)P(a)

  2. B.

     X: P(b)P(a)P(c) Y: P(b)P(c)P(d) Z: P(a)P(c)P(d)

  3. C.

    X: P(b)P(a)P(c) Y: P(c)P(b)P(d) Z: P(a)P(c)P(d)

  4. D.

    X: P(a)P(b)P(c) Y: P(c)P(b)P(d) Z: P(c)P(d)P(a)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 17 · 1 mark Q3716

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.

  1. A.

    1 and 4 only

  2. B.

    1 and 3 only

  3. C.

    2 only

  4. D.

    3 only

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 18 · 1 mark Q3717

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.

  1. A.

    1, 2 and 3

  2. B.

    1 and 2 only

  3. C.

    2 and 3 only

  4. D.

    1 and 3 only

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 19 · 1 mark Q3718

What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of nn vertices?

  1. A.

    Θ(n2)Θ(n^2)

  2. B.

    Θ(n2 log n) Θ(n^2 \ log \ n)

  3. C.

    Θ(n3)Θ(n^3)

  4. D.

    Θ(n3 log n) Θ(n^3 \ log \ n)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 20 · 1 mark Q3719

In a kk-way set associative cache, the cache is divided into vv sets, each of which consists of kk lines. The lines of a set are placed in sequence one after another. The lines in set ss are sequenced before the lines in set (s+1)(s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered jj must be mapped to any one of the cache lines from

  1. A.

    (j mod v)∗k to (j mod v)∗k+(k−1)(j \ mod \ v) * k \ to \ (j \ mod \ v) * k + (k-1)

  2. B.

    (j mod v) to (j mod v)+(k−1)(j \ mod \ v) \ to \ (j \ mod \ v) + (k-1)

  3. C.

    (j mod k) to (j mod k)+(v−1)(j \ mod \ k) \ to \ (j \ mod \ k) + (v-1)

  4. D.

    (j mod k)∗v to (j mod k)∗v+(v−1)(j \ mod \ k) * v \ to \ (j \ mod \ k) * v + (v-1)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 21 · 1 mark Q3720

Which one of the following expressions does NOT represent exclusive NOR of xx and yy?

  1. A.

    xy+x′y′xy + x′ y′

  2. B.

    x⊕y′x\oplus y′

  3. C.

    x′⊕yx′\oplus y

  4. D.

    x′⊕y′x′\oplus y′

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 22 · 1 mark Q3721

Which one of the following functions is continuous at xx = 3?

  1. A.

    f(x)={2,if x=3 x−1if x>3x+33if x<3 f(x) = \begin{cases} 2,&\text{if $x = 3$ } \\ x-1& \text{if $x > 3$}\\ \frac{x+3}{3}&\text{if $x < 3$ } \end{cases}

  2. B.

    f(x)={4,if x=3 8−xif x≠3f(x) = \begin{cases} 4,&\text{if $x = 3$ } \\ 8-x& \text{if $x \neq 3$} \end{cases}

  3. C.

    f(x)={x+3,if x≤3 x−4if x>3f(x) = \begin{cases} x+3,&\text{if $x \leq 3$ } \\ x-4& \text{if $x > 3$} \end{cases}

  4. D.

    f(x)={1x3−27if x≠3 f(x) = \begin{cases} \frac{1}{x^3-27}&\text{if $x \neq 3$ } \end{cases}

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 23 · 1 mark Q3722

Function ff is known at the following points:

The value of ∫03f(x)dx\int_{0}^{3} f(x) \text{d}x computed using the trapezoidal rule is

  1. A.

    8.983

  2. B.

    9.003

  3. C.

    9.017

  4. D.

    9.045

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 24 · 1 mark Q3723

Consider an undirected random 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?

  1. A.

    1/8

  2. B.

    1

  3. C.

    7

  4. D.

    8

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 25 · 1 mark Q3724

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.

  1. A.

    P only

  2. B.

    Q only

  3. C.

    Both P and Q

  4. D.

    Neither P nor Q

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 26 · 1 mark Q3725

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' are incident with the same vertex in G.

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.

  1. A.

    P only

  2. B.

    P and R only

  3. C.

    R only

  4. D.

    P, Q and S only

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 27 · 1 mark Q3726

What is the logical translation of the following statement?

“None of my friends are perfect.”

  1. A.

    ∃x(F(x)∧¬P(x))∃x (F (x)∧ ¬P(x))

  2. B.

    ∃x(¬F(x)∧P(x))∃ x (¬ F (x)∧ P(x))

  3. C.

    ∃x(¬F(x)∧¬P(x))∃x (¬F (x)∧¬P(x))

  4. D.

    ¬∃x(F(x)∧P(x))¬∃ x (F (x)∧ P(x))

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 28 · 1 mark Q3727

Consider the following sequence of micro-operations.

MBR ← PC

MAR ← X

PC ← Y

Memory ← MBR

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

  1. A.

    Instruction fetch

  2. B.

    Operand fetch

  3. C.

    Conditional branch

  4. D.

    Initiation of interrupt service

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 29 · 1 mark Q3728

Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each track contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing format is <cylinder no., surface no., sector no.>. A file of size 42797 KB is stored in the disk and the starting disk location of the file is <1200, 9, 40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?

  1. A.

    1281

  2. B.

    1282

  3. C.

    1283

  4. D.

    1284

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 30 · 1 mark Q3729

The number of elements that can be sorted in Θ(log n)Θ(log \ n) time using heap sort is

  1. A.

    Θ(1) Θ(1)

  2. B.

    Θ(log⁡n)\Theta(\sqrt{\log n})

  3. C.

    Θ(log⁡nlog⁡log⁡n)\Theta(\frac{\log n}{\log \log n})

  4. D.

    Θ(log⁡n)\Theta(\log n)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 31 · 1 mark Q3730

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

  1. A.

    Θ(n2)Θ(n^2)

  2. B.

    Θ(n2log⁡n)\Theta(n^2\log n)

  3. C.

    Θ(n3)\Theta(n^3)

  4. D.

    Θ(n3log⁡n)\Theta(n^3\log n)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 32 · 1 mark Q3731

Consider the following languages.

L1={0p1q0r∣p,q,r≥0}L_1 = \left \{ 0^p1^q0^r \mid p,q,r \geq 0 \right \}

L2={0p1q0r∣p,q,r≥0,p≠r}L_2 = \left \{ 0^p1^q0^r \mid p,q,r \geq 0, p\neq r \right \}

Which one of the following statements is FALSE?

  1. A.

    L2L_2 is context-free.

  2. B.

    L1∩L2L_1∩ L_2 is context-free.

  3. C.

    Complement of L2L_2 is recursive.

  4. D.

    Complement of L1L_1 is context-free but not regular.

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 33 · 1 mark Q3732

Consider the DFA given below:

Which of the following are FALSE?

1. Complement of L(A) is context-free.

2. L(A) = L((11*0+0)(0 + 1)*0*1*)

3. For the language accepted by A, A is the minimal DFA.

4. A accepts all strings over {0, 1} of length at least 2.

  1. A.

    1 and 3 only

  2. B.

    2 and 4 only

  3. C.

    2 and 3 only

  4. D.

    3 and 4 only

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 34 · 1 mark Q2004

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?

  1. A.

    -2

  2. B.

    -1

  3. C.

    1

  4. D.

    2

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 35 · 1 mark Q3734

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) ∏sname(σcourseno=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 ∧ <SR, 107, RP>∈Registration ∧ RP>90)}

  1. A.

    I, II, III and IV

  2. B.

    I, II and III only

  3. C.

    I, II and IV only

  4. D.

    II, III and IV only

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 36 · 2 marks Q3735

Determine the maximum length of the 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.

  1. A.

    1

  2. B.

    2

  3. C.

    2.5

  4. D.

    5

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 37 · 2 marks Q3736

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, and the sequence numbers of the first and the last bytes of the payload, respectively, are

  1. A.

    Last fragment, 2400 and 2789

  2. B.

    First fragment, 2400 and 2759

  3. C.

    Last fragment, 2400 and 2759

  4. D.

    Middle fragment, 300 and 689

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 38 · 2 marks Q3737

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?

  1. A.

    There is no change.

  2. B.

    Average cohesion goes up but coupling is reduced.

  3. C.

    Average cohesion goes down and coupling also reduces.

  4. D.

    Average cohesion and coupling increase.

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 39 · 2 marks Q3738

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: X computes array a, and Y computes array b. The processes use two binary semaphores R and S, both initialized to zero. Array a is shared by the two processes.

Process X

private i;
for (i = 0; i < n; i++) {
    a[i] = f(i);
    ExitX(R, S);
}

Process Y

private i;
for (i = 0; i < n; i++) {
    EntryY(R, S);
    b[i] = g(a[i]);
}

Which one of the following represents the correct implementations of ExitX and EntryY?

  1. A.
    ExitX(R, S) {
        P(R);
        V(S);
    }
    
    EntryY(R, S) {
        P(S);
        V(R);
    }
  2. B.
    ExitX(R, S) {
        V(R);
        V(S);
    }
    
    EntryY(R, S) {
        P(R);
        P(S);
    }
  3. C.
    ExitX(R, S) {
        P(S);
        V(R);
    }
    
    EntryY(R, S) {
        V(S);
        P(R);
    }
  4. D.
    ExitX(R, S) {
        V(R);
        P(S);
    }
    
    EntryY(R, S) {
        V(S);
        P(R);
    }
Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 40 · 2 marks Q3739

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

X → c.X, c/d
X → .cX, c/d
X → .d, c/d
X → c.X, $
X → .cX, $
X → .d, $

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.

  1. A.

    1 only

  2. B.

    2 only

  3. C.

    1 and 4 only

  4. D.

    1, 2, 3 and 4

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 41 · 2 marks Q3740

Which of the following is/are undecidable?

1. GG is a CFG. Is L(G)=ϕL(G) = \phi?

2. GG is a CFG. Is L(G)=∑∗L(G) = ∑^* ?

3. MM is a Turing machine. Is L(M)L(M) regular?

4. AA is a DFA and NN is an NFA. Is L(A)=L(N)L(A) = L(N)?

  1. A.

    3 only

  2. B.

    3 and 4 only

  3. C.

    1, 2 and 3 only

  4. D.

    2 and 3 only

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 42 · 2 marks Q3741

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;
}
  1. A.

    3024

  2. B.

    6561

  3. C.

    55440

  4. D.

    161051

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 43 · 2 marks Q3742

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?

  1. A.

    10, 20, 15, 23, 25, 35, 42, 39, 30

  2. B.

    15, 10, 25, 23, 20, 42, 35, 39, 30

  3. C.

    15, 20, 10, 23, 25, 42, 35, 39, 30

  4. D.

    15, 10, 23, 25, 20, 35, 42, 39, 30

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 44 · 2 marks Q3743

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 queue operations on an initially empty queue?

  1. A.

    Θ(n)Θ(n)

  2. B.

    Θ(n+k) Θ(n + k)

  3. C.

    Θ(nk)Θ(nk)

  4. D.

    Θ(n2)Θ(n^2)

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 45 · 2 marks Q3744

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 I1, I2, I3, …, I12 is executed in this pipelined processor. Instruction I4 is the only branch instruction and its branch target is I9. If the branch is taken during the execution of this program, the time (in ns) needed to complete the program is

  1. A.

    132

  2. B.

    165

  3. C.

    176

  4. D.

    328

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 46 · 2 marks Q3745

A RAM chip has a capacity of 1024 words of 8 bits each (1K × 8). The number of 2 × 4 decoders with enable line needed to construct a 16K × 16 RAM from 1K × 8 RAM is

  1. A.

    4

  2. B.

    5

  3. C.

    6

  4. D.

    7

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 47 · 2 marks Q3746

Which one of the following is NOT logically equivalent to ¬∃x(∀y(α)∧∀z(β))¬∃x (∀ y (α)∧∀z(β ))?

  1. A.

    ∀x(∃z(¬β)→∀y(α))∀ x (∃ z(¬β )→∀ y (α))

  2. B.

    ∀x(∀z(β)→∃y(¬α))∀x (∀ z(β )→∃ y (¬α))

  3. C.

    ∀x(∀y(α)→∃z(¬β))∀x (∀ y (α)→∃z(¬β ))

  4. D.

    ∀x(∃y(¬α)→∃z(¬β)) ∀x (∃ y (¬α)→∃z(¬β ))

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 48 · 2 marks Q70268

The following code segment is executed on a processor which allows only register operands in its instructions. Each instruction can have at most two source operands and one destination operand. Assume that all variables are dead after this code segment.

c = a + b;

d = c * a;

e = c + a;

x = c * c;

if (x > a) {
   y = a * a;
}
else {
   d = d * d;
   e = e * e;
}

Suppose the instruction set architecture of the processor has only two registers. The only allowed compiler optimization is code motion, which moves statements from one place to another while preserving correctness. What is the minimum number of spills to memory in the compiled code?

  1. A.

    0

  2. B.

    1

  3. C.

    2

  4. D.

    3

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 49 · 2 marks Q3748

The following code segment is executed on a processor which allows only register operands in its instructions. Each instruction can have at most two source operands and one destination operand. Assume that all variables are dead after this code segment.

c = a + b;
d = c * a;
e = c + a;
x = c * c;
if (x > a) {
    y = a * a;
} else {
    d = d * d;
    e = e * e;
}

What is the minimum number of registers needed in the instruction set architecture of the processor to compile this code segment without any spill to memory? Do not apply any optimization other than optimizing register allocation.

  1. A.

    3

  2. B.

    4

  3. C.

    5

  4. D.

    6

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 50 · 2 marks Q3749

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) {
    for (int i = 0; i < 5; i++)
        for (int j = 0; j < 3; j++)
            if (A[i] == oldc[j])
                A[i] = newc[j];
}

The procedure is tested with the following four test cases:

  1. oldc = "abc", newc = "dab"

  2. oldc = "cde", newc = "bcd"

  3. oldc = "bca", newc = "cda"

  4. oldc = "abc", newc = "bac"

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

  1. A.

    Only one

  2. B.

    Only two

  3. C.

    Only three

  4. D.

    All four

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 51 · 2 marks Q3750

 The procedure given below is required to find and replace certain characters inside an input character string supplied in array AA. The characters to be replaced are supplied in array oldcoldc, while their respective replacement characters are supplied in array newcnewc. Array AA has a fixed length of five characters, while arrays oldcoldc and newcnewc contain three characters each. However, the procedure is flawed.

void find_and_replace (char *A, char *oldc, char *newc) {
    for (int i = 0; i < 5; i++)
        for (int j = 0; j < 3; j++)
            if (A[i] == oldc[j])
                A[i] = newc[j];
}

The procedure is tested with the following four test cases.

  1. oldc = "abc", newc = "dab"

  2. oldc = "cde", newc = "bcd"

  3. oldc = "bca", newc = "cda"

  4. oldc = "abc", newc = "bac"

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

  1. A.

    None

  2. B.

    2 only

  3. C.

    3 and 4 only

  4. D.

    4 only

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 52 · 2 marks Q73396

A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table (T1), which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16-way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

What is the size of a page in KB in this computer?

  1. A.

    2

  2. B.

    4

  3. C.

    8

  4. D.

    16

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 53 · 2 marks Q3752

A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table (T1), which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16-way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?

  1. A.

    2

  2. B.

    4

  3. C.

    8

  4. D.

    16

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 54 · 2 marks Q2052

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values.
F = {CH → G, A → BC, B → CFH, E → A, F → EG} is a set of functional dependencies (FDs) such that F+ is exactly the set of FDs that hold for R. How many candidate keys does the relation R have?

  1. A.

    3

  2. B.

    4

  3. C.

    5

  4. D.

    6

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 55 · 2 marks Q3754

 Relation RR has eight attributes ABCDEFGHABCDEFGH. Fields of RR contain only atomic values.

F=CH→G,A→BC,B→CFH,E→A,F→EGF={CH→G, A→BC, B→CFH, E→A, F→EG} is a set of functional dependencies (FDs) so that F+F^+ is exactly the set of FDs that hold for RR.

The relation R is

  1. A.

    in 1NF, but not in 2NF.

  2. B.

    in 2NF, but not in 3NF.

  3. C.

    in 3NF, but not in BCNF.

  4. D.

    in BCNF.

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 56 · 2 marks Q3690

Which one of the following options is the closest in meaning to the word given below?

Nadir

  1. A.

    Highest

  2. B.

    Lowest

  3. C.

    Medium

  4. D.

    Integration

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 57 · 2 marks Q3691

Complete the sentence:

Universalism is to particularism as diffuseness is to _______________.

  1. A.

    specificity

  2. B.

    neutrality

  3. C.

    generality

  4. D.

    adaptation

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 58 · 2 marks Q3692

What will be the maximum sum of 44, 42, 40, ...... ?

  1. A.

    502

  2. B.

    504

  3. C.

    506

  4. D.

    500

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 59 · 2 marks Q3693

Were you a bird, you ___________________ in the sky.

  1. A.

    would fly

  2. B.

    shall fly

  3. C.

    should fly

  4. D.

    shall have flown

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): A

Solutions and video are in the course

Question 60 · 2 marks Q3694

Choose the grammatically INCORRECT sentence:

  1. A.

    He is of Asian origin.

  2. B.

    They belonged to Africa.

  3. C.

    She is an European.

  4. D.

    They migrated from India to Australia.

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 61 · 2 marks Q3695

Find the sum of the expression

1/(√1+√2) + 1/(√2+√3) + 1/(√3+√4) + ............ + 1/(√80+√81)

  1. A.

    7

  2. B.

    8

  3. C.

    9

  4. D.

    10

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course

Question 62 · 2 marks Q3696

Out of all the 2-digit integers between 1 and 100, a 2-digit number has to be selected at random. What is the probability that the selected number is not divisible by 7?

  1. A.

    13/90

  2. B.

    12/90

  3. C.

    78/90

  4. D.

    77/90

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 63 · 2 marks Q3697

After several defeats in wars, Robert Bruce went in exile and wanted to commit suicide. Just before committing suicide, he came across a spider attempting tirelessly to have its net. Time and again, the spider failed but that did not deter it to refrain from making attempts. Such attempts by the spider made Bruce curious. Thus, Bruce started observing the near-impossible goal of the spider to have the net. Ultimately, the spider succeeded in having its net despite several failures. Such act of the spider encouraged Bruce not to commit suicide. And then, Bruce went back again and won many a battle, and the rest is history.

Which one of the following assertions is best supported by the above information?

  1. A.

    Failure is the pillar of success.

  2. B.

    Honesty is the best policy.

  3. C.

    Life begins and ends with adventures.

  4. D.

    No adversity justifies giving up hope.

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): D

Solutions and video are in the course

Question 64 · 2 marks Q3698

A tourist covers half of his journey by train at 60 km/h, half of the remainder by bus at 30 km/h and the rest by cycle at 10 km/h. The average speed of the tourist in km/h during his entire journey is

  1. A.

    36

  2. B.

    30

  3. C.

    24

  4. D.

    18

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): C

Solutions and video are in the course

Question 65 · 2 marks Q3699

The current erection cost of a structure is Rs. 13,200. If the labour wages per day increase by 1/5 of the current wages and the working hours decrease by 1/24 of the current period, then the new cost of erection in Rs. is

  1. A.

    16,500

  2. B.

    15,180

  3. C.

    11,000

  4. D.

    10,120

Official answer key

Official answer key (GATE Computer Science & IT 2013 GATE 2013 · CS): B

Solutions and video are in the course