Computer Science (GATE Exam) 2013 - Previous Question Paper Solution

Description: GATE Exam Previous Year Question Paper Solution Computer Science(CS) - 2013
Number of Questions: 63
Created by:
Tags: Computer Science GATE CS Previous Year Paper
Attempted 0/62 Correct 0 Score 0

Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is ½. What is the expected number of unordered cycles of length three?

  1. 1/8

  2. 1

  3. 7

  4. 8


Correct Option: C
Explanation:

P(edge) $ = \dfrac{1}{2}$ Number of ways we can choose the vertices out of 8 is $^8C_2$. (Three edges in each cycle) Expected number of unordered cycles of length 3 =$^8C_2$$ \times \left( \dfrac{1}{2} \right)^3$

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. P only

  2. Q only

  3. Both P and Q

  4. Neither P nor Q


Correct Option: C
Explanation:

Sum of degrees of all vertices = 2 ×number of edges

Which one of the following expressions does NOT represent exclusive NOR of x and y?

  1. xy + x 'y'

  2. x $\oplus$ y

  3. x' $\oplus$y

  4. x' $\oplus$y'


Correct Option: D
Explanation:

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

  1. $f(x)= \begin{cases} 2 \text{, if x = 3} \\ x -1 \text{ if }\ x \gt 3 \\ \dfrac{x+3}{3} \text{ if }\ x \gt 3 \end{cases} $

  2. $f(x)= \begin{cases} 4 \text{, if x = 3} \\ 8-x\ \text{if}\ x \ne 3 \end{cases} $

  3. $f(x)= \begin{cases} x+3 \text{, if } x = 3 \\ x -4 \text{ if } x \ne 3 \end{cases} $

  4. $f(x) = \dfrac{1}{x^3 - 27} \text{, if } x \ne 3$


Correct Option: A
Explanation:

$ \lim_{x \to 3+} f(x) = \lim_{x \to 3+} (x -1) = 2 = f(3)$ $ \lim_{x \to 3-} f(x) = \lim_{x \to 3-} \left(\dfrac{x+3}{3} \right)= 2 = f(3)$ $\therefore$ $f(x)$is continuous at x = 3.

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 from 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from

  1. (j mod v) *k to (j mod v) * k + (k - 1)

  2. (j mod v) to (j mod v) + (k - 1)

  3. (j mod k) to (j mod k) + (v - 1)

  4. (j mod k) * v to (j mod k) * v + (v - 1)


Correct Option: B
Explanation:

Set number in the cache = (main memory block number) MOD number of sets in the cache As the lines in the set are placed in sequence, we can have the lines from 0 to K – 1 in the set. Number of sets = v Main memory block number = j First line = (j mod v); last line = (j mod v) + (k – 1)

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. 1, 2 and 3

  2. 1 and 2 only

  3. 2 and 3 only

  4. 1 and 3 only


Correct Option: A
Explanation:
  1. Cycle detection using DFS:  O(V + E) = O(V2 ) and it is polynomial problem
    1. Every P-problem is NP (since P $\subset$ NP)
    2. NP–complete Î NP Hence, NP–complete can be solved in non-deterministic polynomial time

Which of the following statements is/are FALSE? (1) For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. (2) Turing recognisable languages are closed under union and complementation. (3) Turing decidable languages are closed under intersection and complementation. (4) Turing recognisable languages are closed under union and intersection.

  1. 1 and 4 only

  2. 1 and 3 only

  3. 2 only

  4. 3 only


Correct Option: C
Explanation:

(1) NTM $\cong$ DTM (2) RELs are closed under union but not complementation. (3) Turing decidable languages are recursive and recursive languages are closed under intersection and complementation. (4) RELs are closed under union and intersection but not under complementation.

An index is clustered, if

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

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

  3. the data records of the file are organised in the same order as the data entries of the index

  4. the data records of the file are organised not in the same order as the data entries of the index


Correct Option: C
Explanation:

Clustered index is built on ordering non-key field and hence, if the index is clustered, then the data records of the file are organised in the same order as the data entries of the index.

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

  1. TCP, UDP, UDP and TCP

  2. UDP, TCP, TCP and UDP

  3. UDP, TCP, UDP and TCP

  4. TCP, UDP, TCP and UDP


Correct Option: C
Explanation:

Real-time multimedia needs connectionless service, so underlying transport layer protocol used is UDP. File transfer runs over TCP protocol with port no. 21. DNS runs over UDP protocol within port no. 53. Email needs SMTP protocol which runs over TCP protocol within port no. 25.

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

  1. $\Theta$(n2)

  2. $\Theta$(n2 logn)

  3. $\Theta$(n3)

  4. $\Theta$(n3 logn)


Correct Option: C
Explanation:

Bellman – Ford time complexity: $\Theta$ (|V|×|E|) For complete graph = |E| = $\dfrac{n(n-1)}{2}$             |V| = n             $\therefore$$\Theta$$\left( n \times \dfrac{n(n-1)}{2} \right) = \Theta(n2)$

Assume that source S and destination D are connected through two intermediate routers labelled R. Determine how many times does each packet has to visit the network layer and the data link layer during a transmission from S to D.

  1. Network layer - 4 times and Data link layer - 4 times

  2. Network layer - 4 times and Data link layer - 3 times

  3. Network layer - 4 times and Data link layer - 6 times

  4. Network layer - 2 times and Data link layer - 6 times


Correct Option: C
Explanation:

From above given diagram, it is clearly visible that packet will visit network layer 4 times, once at each node [S, R, R, D] and it will visit Data Link layer 6 times. One time at S and one time at D, then two times for each intermediate router R as data link layer is used for link-to-link communication. Once a packet reaches R and goes up from physical-DL-Network and second time when packet comes out of router in the order Network-DL-Physical.

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 initialised to one. Which one of the following represents a deadlock-free order of invoking the P operations by the processes?

  1. $X:$ $P(a)P(b)P(c)$ $Y:$ $P(b)P(c)P(d)$ $Z:$ $P(c)P(d)P(a)$

  2. $X:$ $P(b)P(a)P(c)$ $Y:$ $P(b)P(c)P(d)$ $Z:$ $P(a)P(c)P(d)$

  3. $X:$ $P(b)P(a)P(c)$ $Y:$ $P(c)P(b)P(d)$ $Z:$ $P(a)P(c)P(d)$

  4. $X:$ $P(a)P(b)P(c)$ $Y:$ $P(c)P(b)P(d)$ $Z:$ $P(c)P(d)P(a)$


Correct Option: B
Explanation:

Suppose X performs P(2) and preempts, Y gets chance, but cannot do its first wait, i.e. P(2), so waits for X, now Z gets the chance and performs P(1) and preempts, next X gets chance. X cannot continue as wait on ‘a’ is done by Z already, so X waits for Z. At this time, Z can continue its operations as down on c and d. Once Z finishes, X can do its operations and so Y. In any of the execution orders of X, Y and Z, one process can continue and finish, such that waiting is not circular. In options (1), (3) and (4), we can easily find circular wait and thus, deadlock.

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 n nodes?

  1. O(1)

  2. O(log n)

  3. O(n)

  4. O(n log n)


Correct Option: C
Explanation:

For skewed binary search tree on n nodes, the tightest upper bound to insert a node is O(n).

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 $\rightarrow$$\in$ Î and A $\rightarrow$ a) to parse a string with n tokens?

  1. n/2

  2. n-1

  3. 2n-1

  4. 2n


Correct Option: C
Explanation:

2 × (4) − 1 = 7 reductions $\Rightarrow$2n − 1 reductions are required. [Note: Unit production is given as A $\rightarrow$ a, it was typo] Above reductions are not in reverse of RMD but when they are reduced in bottom-up parsing, we will get same number of reductions.

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

  1. O(log n)

  2. O(n)

  3. O(n log n)

  4. O(n2)


Correct Option: B
Explanation:

The maximum number of swaps that takes place in selection sort on n numbers is O(n).

What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?

  1. $\Theta$(n)

  2. $\Theta$ (n + k)

  3. $\Theta$ (nk)

  4. $\Theta$ (n2)


Correct Option: C
Explanation:

null

Consider the languages L1 = $\phi$ and L2 = {a}. Which one of the following represents L1 $L_2^$$UL_2^$?

  1. {$\in$}

  2. $\phi$

  3. $a^*$

  4. {$\epsilon, a$}


Correct Option: A
Explanation:

Concatenation of empty language with any language will give the empty language and $L_1^=\phi_ = \epsilon$. Hence, $L_1 L_2^* UL_1^* = \{\epsilon \}$

Using public key cryptography, X adds a digital signature $\sigma$to message M, encrypts <M, $\sigma$>, and sends it to Y, where it is decrypted. Which one of the following sequences of keys is used for the operations?

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

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

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

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


Correct Option: D
Explanation:

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

  1. -256

  2. -128

  3. -127

  4. 0


Correct Option: B
Explanation:

-28-1 = -128

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 9 I9. If the branch is taken during the execution of this program, the time (in ns) needed to complete the program is

  1. 132

  2. 165

  3. 176

  4. 328


Correct Option: C
Explanation:

Total clock slots taken are 16. Each slot will take maximum of {5, 7, 10, 8, 7} = 10. Hence, total slots for all the instructions = 16 × 10 + 16 (pipeline delay) = 176

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. 10, 20, 15, 23, 25, 35, 42, 39, 30

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

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

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


Correct Option: D
Explanation:

Preorder: 30, 20, 10, 15, 25, 23, 39, 35, 42 Postorder: 10, 15, 20, 23, 25, 30, 35, 39, 42

What is the return value of f(p, p) if the value of p is initialised 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 &amp;x, int c) {
  c = c  – 1;
  if (c == 0) return 1;
  x = x + 1;
  return f (x, c) * x;
}
  1. 3024

  2. 6561

  3. 55440

  4. 161051


Correct Option: B
Explanation:

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.

  1. 1

  2. 2

  3. 2.5

  4. 5


Correct Option: B
Explanation:

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

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

  2. P – 3, Q – 4, R – 2, S – 1

  3. P – 3, Q – 1, R – 4, S – 2

  4. P – 4, Q – 3, R – 2, S – 1


Correct Option: C

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. Last fragment; 2400 and 2789

  2. First fragment; 2400 and 2759

  3. Last fragment; 2400 and 2759

  4. Middle fragment; 300 and 689


Correct Option: C
Explanation:

M = 0 – Means there is no fragment after this, i.e. Last fragment HLEN = 10 So, header length is 4 ×10 = 40, as 4 is constant scale factor. Total length = 400(40 Byte Header + 360 Byte Payload) Fragment Offset = 300, that means 300 × 8 bytes = 2400 bytes are before this last fragment. So, the position of datagram is last fragment. Sequence number of First Byte of Payload = 2400 (as 0 to 2399 sequence numbers are used) Sequence number of Last Byte of Payload = 2400 + 360-1 = 2759

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

  1. $\begin{vmatrix} 1& x(x+1) & x+1\\ 1& y(y+1) & y+1\\ 1& z(z+1) & z+1 \end{vmatrix}$

  2. $\begin{vmatrix} 1& x+1 & x^{2}+1\\ 1& y+1 & y^{2}+1\\ 1& z+1 & z^{2}+1 \end{vmatrix}$

  3. $\begin{vmatrix} 0& x-y & x^{2}-y^{2}\\ 0& y-z & y^{2}-z^{2}\\ 1& z & z^{2} \end{vmatrix} $

  4. $\begin{vmatrix} 2& x+y & x^{2}+y^{2}\\ 2& y+z & y^{2}+z^{2}\\ 1& z & z^{2} \end{vmatrix}$


Correct Option: A
Explanation:

If matrix B is obtained from matrix A by replacing the lth row by itself plus k times the mth row for l $\sigma$ m, then det(2) = det(1). With this property, given matrix is equal to the matrices given in the options (2), (3) and (4).

Which of the following is/are undecidable?

  1. G is a CFG. Is L (G) = $\phi$?
  2. G is a CFG. IS L (G) = $\sum *$?
  3. M is a Turning machine. Is L (M) regular?
  4. A is a DFA and N is an NFA. Is L (A) = L (N)?
  1. 3 only

  2. 3 and 4 only

  3. 1, 2 and 3 only

  4. 2 and 3 only


Correct Option: D
Explanation:

There is an algorithm to check whether the given CFG is empty, finite or infinite and also to convert NFA to DFA. Hence, 1 and 4 are decidable.

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. 4

  2. 5

  3. 6

  4. 7


Correct Option: B
Explanation:

RAM chip size = 1k × 8 [1024 words of 8 bits each] RAM to construct =16k × 16 Number of chips required = $\dfrac{16k +16}{1k + 8}=16 \times 2$ [16 chips vertically with each having 2 chips horizontally] So, to select one chip out of 16 vertical chips, we need 4 × 16 decoder. Available decoder is – 2 × 4 decoder. To be constructed is 4 × 16 decoder.

So, we need five 2 × 4 decoders in total to construct a 4 × 16 decoder.

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

  1. 8(2e3)

  2. 9/(2e3)

  3. 17/(2e3)

  4. 26/(2e3)


Correct Option: C
Explanation:

A shared variable x, initialised to zero, is operated on by four concurrent processes W, X, Y and 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 initialised to two. What is the maximum possible value of x after all processes complete execution?

  1. –2

  2. –1

  3. 1

  4. 2


Correct Option: D
Explanation:

Consider the following two sets of LR (1) items of an LR (1) grammar X $\rightarrow$ c. X c / d X $\rightarrow$ c.X, $ X $\rightarrow$ .Cx, c / d X $\rightarrow$.Cx, $ X $\rightarrow$ .d, c / d X $\rightarrow$.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. 1 only

  2. 2 only

  3. 1 and 4 only

  4. 1, 2, 3 and 4


Correct Option: D
Explanation:

  1. Merging of two sets depends on core part (production rule with dot operator), not on look aheads.
  2. The two states are not containing Reduce item. So after merging, the merged state cannot contain any S-R conflict.
  3. As there is no reduce item in any of the state, so the scenario can’t have R-R conflict.
  4. Merging of sets does not depend on further goto on any terminal. So, all statements are false.

Function f(x) is known at the following points: x 0 0.3 0.6 0.9 1.2 1.5 1.8 2.1 2.4 2.7 3.0 f(x) 0 0.09 0.36 0.81 1.44 2.25 3.24 4.41 5.76 7.29 9.00

The value of $\int_0^2 f$ (x) dx computed using the trapezoidal rule is

  1. 8.983

  2. 9.003

  3. 9.017

  4. 9.045


Correct Option: D
Explanation:

$\int_0^3 f(x) dx = \dfrac{h}{2}[f(x_0) + f(x_10) + 2(f(x_1) + f(x_2) + ...... +f(x_g) )]$ $= \dfrac{0.3}{2}[9.00 + 2(25.65)] = 9.045$ 

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 &gt;90

(II) $ \prod_{sname}(σ_{courseno=107 ∧ percent > 90} (Registration ⋈ Students)) $

(III) $\left\{T \mid ∃S \in Students, ∃R \in Registration ( S.rollno=R.rollno \land R.courseno=107 ∧ R.percent>90 ∧T.sname=S.sname)\right \}$

(IV) $\left\{ \langle S_N\rangle \mid ∃S_R∃R_P (\langle S_R,S_N\rangle ∈Students ∧ \ \langle S_R,107,R_P\rangle ∈Registration ∧ R_P>90) \right\}$

  1. I, II, III and IV

  2. I, II and III only

  3. I, II and IV only

  4. II, III and IV only


Correct Option: A
Explanation:

Four queries given in SQL, RA, TRC and DRC in four statements respectively retrieve the required information.

Consider the following languages:

L1 = {0p 1 q0r | p, q, r $\ge$ 0} L2 = {0p1q0r | p, p, r $\ge$ 0, p $\ne$ r}

Which of the following statements is FALSE?

  1. L2 is context–free.

  2. L12 $\cap$ L2 is context–free.

  3. Complement of L2 is recursive.

  4. Complement of L1 is context–free but not regular.


Correct Option: D
Explanation:

A binary operation $\oplus$on a set of integers is defined as x $\oplus$y = x2 + y2. Which of the following is TRUE about $\oplus$?

  1. Commutative, but not associative

  2. Both commutative and associative

  3. Associative, but not commutative

  4. Neither commutative nor associative


Correct Option: A
Explanation:

x $\oplus$y = x2 + y2 = y2 + x2 = y $\oplus$ x $\therefore$ commutative Not associative because: (1$\oplus$2) $\oplus$ 3 $\ne$1 $\oplus$ (2$\oplus$3)

Consider the following sequence of micro–operations: MBR$\leftarrow$ PC MAR $\leftarrow$X PC $\leftarrow$Y Memory MBR Which one of the following is a possible operation performed by this sequence?

  1. Instruction fetch

  2. Operand fetch

  3. Conditional branch

  4. Initiation of interrupt service


Correct Option: D
Explanation:

PC content is stored in memory via MBR and PC gets new address from Y. It represents a function call (routine), which is matching with interrupt service initiation.

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

  1. $\Theta(1)$

  2. $\Theta(\sqrt{\log} n)$

  3. $\Theta(\frac{\log n}{\log \log n})$

  4. $\Theta(\log n)$


Correct Option: A
Explanation:

After constructing a max-heap in the heap sort, the time to extract maximum element and then heapifying the heap takes $\Theta$(log n) time by which we could say that $\Theta$ (log n) time is required to correctly place an element in sorted array. If $\Theta$ (logn) time is taken to sort using heap sort, then number of elements that can be sorted is constant which is $\Theta$ (1).

Consider the following function.

int unknown (int n) {
    int i, j, k 0;
    for i n / 2; i 
  1. $\Theta$ (n2)

  2. $\Theta$ (n2logn)

  3. $\Theta$ (n3)

  4. $\Theta$ (n3logn)


Correct Option: B
Explanation:

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. Only one

  2. Only two

  3. Only three

  4. All four


Correct Option: B
Explanation:

Flaw in this given procedure is that one character of Array ‘A’ that can be replaced by more than one characters of 'newc' array, which should not be so. Test cases (3) and (4) identify this flaw as they are containing ‘oldc’ and ‘newc’ array characters arranged in specific manner. Following string can reflect flaw, if tested by test case (3).

Likewise, single character ‘b’ in A is replaced by ‘c’ and then by ‘d’. Same way, test case (4) can also catch the flaw.

What is the logical translation of the following statement?

“None of my friends is perfect.”

  1. $∃x(F (x)∧ ¬P(x))$

  2. $∃ x(¬ F (x)∧ P(x))$

  3. $ ∃x(¬F (x)∧¬P(x))$

  4. $ ¬∃ x(F (x)∧ P(x))$


Correct Option: D
Explanation:

“None of my friends is perfect” $ \begin{aligned} \qquad & = \forall x(F (x)∧ \neg P(x)) \\ & = \forall x( \neg F (x)∧ \neg P(x)) \\ & = ¬∃ x(F (x)∧ P(x)) \end{aligned} $

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. P only

  2. P and R only

  3. R only

  4. P, Q and S only


Correct Option: B
Explanation:

P) The line graph of a cycle is a cycle.

R) Line graph of planar graph is planar.

S)

The line graph of a tree need not be tree.

Consider a hard disk with 16 recording surfaces (0 – 15) having 16384 cylinders (0 − 16383) and each cylinder contains 64 sectors (0 − 63). Data storage capacity in each sector is 512 bytes. Data are organised cylinder–wise and the addressing format is <cylinder 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. 1281

  2. 1282

  3. 1283

  4. 1284


Correct Option: D
Explanation:

42797 KB $\equiv \dfrac{72797 \times 1025}{512}$= 85594 sectors Starting of 1200, 9, 40 contains total 24 + (6 × 64) = 408 sectors Next, 1201, --------, 1283 cylinders contains total 1024 × 83 = 84992 sectors ($\because$ each cylinder contains 16641024 sectors) $\therefore$Total = 408 + 84992 = 85400 sectors $\therefore$ The required cylinder number is (1284) which will contain the last sector of the file.

A certain computation generates two arrays a and b such that a [i] = f (i) for 0 $\le$ i < n and b [i] = g (a [i]) for 0 $\le$ 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 initialised to zero. The array a is shared by the two processes. The structures of the processes are shown below.

Process X; 
Process Y;
private i;
private i;
for (i = 0; i &lt; n; i + +) {                            
  for (i = 0; i &lt; n; i + +) {
         a [i] = f (i);
         EntryY (R, S);
         ExitX (R, S); 
         b [i] = g (a [i]);
    }
}

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

  1. ExitX (R, S) {
       P (R) ;
       V (S) ;
    }
    EntryY (R, S) {
       P (S);
       V (R);
    }
    
  2. ExitX(R, S) { 
      V (R); 
      V (S);
    }
    EntryY (R, S) {
      P (R);
      P (S);
    }
    
  3. ExitX (R, S) {
      P (S);
      V (R);
    }
    EntryY (R, S) {
      V (S);
       P (R);
    }
    
  4. ExitX (R, S) {
      V (R);
      P (S);
    }
    EntryY (R, S) {
      V (S);
      P (R);
    }
    

Correct Option: B

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. There is no change.

  2. Average cohesion goes up but coupling is reduced.

  3. Average cohesion goes down and coupling also reduces.

  4. Average cohesion and coupling increase.


Correct Option: B
Explanation:

null

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. 1 and 3 only

  2. 2 and 4 only

  3. 2 and 3 only

  4. 3 and 4 only


Correct Option: D
Explanation:

(1) L (A) is regular, its complement is also regular and if it is regular it is also context-free. (2) L (A)11* 0 00 1* 0 * 1 * =1 * 0 0 1* Language has all strings where each string contains ‘0’. (3) A is not minimal, it can be constructed with 2 states. (4) Language has all strings, where each string contains ‘0’ (atleast length one).

Direction: The following code segment is executed on a processor which allows only register operands in its instructions. Each instruction can have almost 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 optimisation 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. 0

  2. 1

  3. 2

  4. 3


Correct Option: C
Explanation:

In the above code, total number of spills to memory is 2.

Direction: The following code segment is executed on a processor which allows only register operands in its instructions. Each instruction can have almost 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 &gt; 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 optimisation other than optimising register allocation.

  1. 3

  2. 4

  3. 5

  4. 6


Correct Option: B
Explanation:

In the above code, minimum number of registers used = 4

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&lt;5; i++)
        for (int j=0; j&lt;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. None

  2. 2 only

  3. 3 and 4 only

  4. 4 only


Correct Option: C
Explanation:

Now for string “abcde” in array A, both test cases (3) and (4) will be successful in finding the flaw, as explained in the above question.

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F = {CH $\leftarrow$ G, A $\rightarrow$ BC, B $\rightarrow$ CFH, E $\rightarrow$ A, F $\rightarrow$ EG} is a 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?

  1. 3

  2. 4

  3. 5

  4. 6


Correct Option: B
Explanation:

Candidate keys are AD, BD, ED and FD.

A computer uses 46–bit virtual address, 32–bit physical address and a three–level paged page table organisation. 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. 2

  2. 4

  3. 8

  4. 16


Correct Option: B
Explanation:

As it is virtually indexed

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

  1. 13/90

  2. 12/90

  3. 78/90

  4. 77/90


Correct Option: D
Explanation:

The number of 2-digit multiples of 7 = 13 $\therefore$        Probability of choosing a number not divisible by $7 = \dfrac{90-13}{90} = \dfrac{77}{90}$

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

  1. 36

  2. 30

  3. 24

  4. 18


Correct Option: C
Explanation:

Let the total distance covered be ‘D’. Now, average speed = $\dfrac{d}{\text{Total time taken}}$

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

Inputs Outputs
--- ---
D0 D1
0 0
1 0
0 1
1 X
X X

What function does the truth table represent?

  1. Priority encoder

  2. Decoder

  3. Multiplexer

  4. Demultiplexer


Correct Option: A
Explanation:

4 to 2 priority encoder

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

The relation R is

  1. in INF, but not in 2NF

  2. in 2NF, but not in 3NF

  3. in 3NF, but not in BCNF

  4. in BCNF


Correct Option: A
Explanation:

A $\rightarrow$ BC, B $\rightarrow$ CFH and F $\rightarrow$ EG are partial dependencies. Hence, it is in 1NF but not in 2NF.

Directions: Fill in the blank. Were you a bird, you ___________ in the sky.

  1. would fly

  2. shall fly

  3. should fly

  4. shall have flown


Correct Option: A
Explanation:

Correct Answer: would fly In conditional sentences with simple past we use 'would + verb'. So with 'were' we will use 'would fly'.

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 battles and the rest is history. Which one of the following assertions is best supported by the above information?

  1. Failure is the pillar of success.

  2. Honesty is the best policy.

  3. Life begins and ends with adventures.

  4. No adversity justifies giving up hope.


Correct Option: D
Explanation:

Correct Answer: No adversity justifies giving up hope.The passage with the example of the spider and Bruce is clearly indicating that despite failures, one should not give up hope.

Complete the following sentence. Universalism is to particularism as diffuseness is to _______.

  1. specificity

  2. neutrality

  3. generality

  4. adaptation


Correct Option: A
Explanation:

The relation is that of antonyms.

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. 2

  2. 4

  3. 8

  4. 16


Correct Option: A

Choose the grammatically INCORRECT sentence from the given options.

  1. He is of Asian origin.

  2. They belonged to Africa.

  3. She is an European.

  4. They migrated from India to Australia.


Correct Option: C
Explanation:

Correct Answer: She is an European. Since, 'European' begins with the sound of 'y' we will use 'a' before it. Only with words beginning with a vowel sound we use 'an'.

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. 16,500

  2. 15,180

  3. 11,000

  4. 10,120


Correct Option: B
Explanation:

Let ‘W’ be the labour wages and ‘T’ be the working hours. Now, total cost is a function of W × T. Increase in wages = 20% $\therefore$ Revised wages = 1.2 W Decrease in labour time = $\left( \dfrac{100}{24}\% \right)$ $\therefore$Revised time = $\left( 1- \dfrac{1}{24}\right)T = \dfrac{23}{24}T$ $\therefore$Revised total cost = 1.2 $\times \dfrac{23}{24}$WT = 1.15 × WT                                     = 1.15 × 13200 = 15,180

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

  1. Highest

  2. Lowest

  3. Medium

  4. Integration


Correct Option: B
Explanation:

Nadir is the lowest point on a curve.

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

  1. $∀ x(∃ z(¬β )→∀ y(α))$

  2. $∀x(∀ z(β )→∃ y(¬α))$

  3. $∀x(∀ y(α)→∃z(¬β ))$

  4. $∀x(∃ y(¬α)→∃z(¬β ))$


Correct Option: A
Explanation:

- Hide questions