0% found this document useful (0 votes)
23 views

© All Rights Reserved by GATE Forum Educational Services Pvt. Ltd. No Part of This Booklet May Be Reproduced or Utilized in Any Form Without The Written Permission. Discuss This Questions Paper at

Uploaded by

neerajdixit90
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

© All Rights Reserved by GATE Forum Educational Services Pvt. Ltd. No Part of This Booklet May Be Reproduced or Utilized in Any Form Without The Written Permission. Discuss This Questions Paper at

Uploaded by

neerajdixit90
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

||Tcst ID: 00 A!! India FREE Mnck GATE Tcst uuu.guteforum.

com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 1 of 6
Answer key: All India FREE Mock GATE Test: CS:
























Explanations:
1. (A) ( ) ( ) ( ) ( )
1
12
P B C P B P A B C P A B C
2. (B) Let matrix A is of order m n
Let matrix B is of order n p
For matrix product AB,
The number of multiplication operations = mpn
The number of addition operations = mp(n - 1)
Here m = 3, n = 4, p = 5
3. (A) 4. (D) 5. (A) 6. (A)
7. (A) 8. (B) 9. (B)
10. (A) The statement defines a tree and the maximum number of edges in a tree is ( n - 1)
11. (A) First sort the degree vertex which gives us (5, 4, 3, 3, 2). Let label these vertices as (a, b, c, d, e)
respectively and the new vertex (to be added) as `f. The vertex `a (degree 5) should be adjacent to 5
vertices. This means `f vertex should have a degree of at least 1. The second vertex should be adjacent to
another 3 vertices as vertex `a is already adjacent to this contributing 1 degree. We will take these 3 vertices
as (c, d, e). The vertex `c should be adjacent to another vertex as `a and `b are already
adjacent to this. This we can take as `d. With this all degrees are satisfied for all vertices. So the new vertex
`f should have a degree of 1.
12. (C) As the problem definition says `n vertices are divided into `k trees. Let these tress are having x1, x2, x3, .,
xk vertices respectively. The sum of x1, x2, ., xk should be `n as we have only `n vertices in total. The
definition of tree says that any tree with `u vertices will have `u - 1 edges. So all the `k trees will have
`x1 - 1 + x2 - 1 + . + xk - 1 edges.
Result = x1 - 1 + x2 - 1 + . + xk - 1
= x1 + x2 + . + xk - k
= n - k
1 A 2 B 3 A 4 D 5 A 6 A 7 A
8 B 9 B 10 A 11 A 12 C 13 C 14 D
15 D 16 C 17 D 18 C 19 C 20 C 21 C
22 A 23 D 24 B 25 D 26 A 27 A 28 B
29 C 30 B 31 A 32 A 33 B 34 B 35 A
36 A 37 B 38 B 39 A 40 C 41 D 42 B
43 C 44 C 45 A 46 B 47 B 48 B 49 A
50 D 51 A 52 B 53 C 54 A 55 B 56 B
57 C 58 A 59 A 60 C 61 B 62 B 63 A
64 A 65 C 66 C 67 B 68 B 69 A 70 A
71 A 72 B 73 C 74 B 75 B 76 B 77 B
78 A 79 A 80 B 81a B 81b A 82a C 82b B
83a B 83b B 84a A 84b A 85a A 85b B
||Tcst ID: 00 A!! India FREE Mnck GATE Tcst uuu.guteforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 2 of 6
13. (C) A hash function is considered best if it leads to less number of collisions. In this case only the (iii) one leads to
less number of collisions
14. (D) The (iii) assertion is true for only prims algorithm. For kruskals algorithm the intermediate graph neednt be a
tree.
15. (D) See the Automata Theory text book
16. (C) The memory allocated for pointer `s is read-only. We cant modify this. So the result is undefined for `s as
specified by `C language standards
17. (D) We should put a `= = sign instead of `= for proper string copy operation.
18. (C) Only `Keyboard requires a device driver as it is an external peripheral to the system.
19. (C) See the "Deadlock chapter in OS text book
20. (C) Solve the Boolean equation with Karnaugh map for result
21. (C) Try to satisfy the equations with different choices.
22. (A) See the Discrete Mathematics text book
23. (D) All are true for pipeline suffering
24. (B) Each character takes 1 + 8 + 2 = 11 bits to transfer. The baud rate is 8800, i.e., 8800 bits per second. So
800 characters can be transmitted per second
25. (D) Microprogramming is the design of `Control Unit
26. (A) The `host id should have all `0s while taking network address
27. (A) Only one host can send data at a time. Otherwise collisions happen
28. (B) The packet addressing should be taken care by network layer (IP).
No need to register subnet addresses with NIC.
Only UDP is connectionless protocol.
29. (C) Both the regular expressions are equivalent to (a + b)*. So S = T
30. (B) X = -11, Y = 8 and Z = -2. So
( ) XY
Z
= 44 = 00101100 (binary)
31. (A) Let f(x)= e
-x
/x. then its Fourier sine tranform is
i.e Fs { f(x)} = integral 0 to x f(x) sin sx dx = integral 0 to x e
-x
/x sinsx dx= F(s), say
Differentiating both sides with respect to s, we get
D/ds { F(s) } = integral 0 to x e
-x
cos sx/ x dx = integral 0 to x e
-x
cos sx dx= a/ s
2
+ a
2

Integrating w.r.t , we obtain F(s) = integral a/ s
2
+ a
2
ds = tan
-1
+ C
But F(s) = 0 when s=0, since c=0
Hence F(s)= tan
-1
( s/a)
32. (A) The required probability =
3
1 5 1 5
. .
6 6 6 6
| `
+ +

. ,


2
1 5 5 5
. 1
6 6 6 11
]
| `
+ + ]

. , ]
]

33. (B)

2
2
2
2 3
250
250
2
500
2
y x
x
dy
x
dx x
d y
dx x
+

+

when x = 5,

2
2
d
0 and positive
dy y
dx dx

The function is minimum at x = 5.
34. (B)
x 0 1 2 3 4 5 6
f(x) 1 0.5 0.2 0.1 0.0588 0.0385 0.027
y0 y1 y2 y3 y4 y5 y6
By Simpsons
3
8
rule
||Tcst ID: 00 A!! India FREE Mnck GATE Tcst uuu.guteforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 3 of 6
( ) ( )
6
0 6 1 2 4 5 3 2
0
3
3 2 1.3571
8 1
dx h
y y y y y y y
x
] + + + + + +
]
+


35. (A)

( ) ( )
2005 2004
2005
2005
so that
1 2005
0 1
T
T
T T T T T T
P P I
Q PAP
x P Q P P PAP P P PAP PAP P
A

]
]

36. (A) Let x1, x2 , .. Be the variables representing the numbers on the first, second, .. 6
th
ticket. The probability of
drawing a ticket out of 6 tickets is
1/6+ 2. 1/6+ 3.1/6 +4. 1/6 + 5. 1/6 + 6. 6/6=7/2
Expected value of the sum of the numbers on the tickets drawn = E( x1+ x2)= E(x1) + E(x2) = 2. ( 6+1) =
7
38. (B) As they are unlabelled graphs only two distinct graphs are possible.


39. (A) Insert the choices according to the binary search tree construction algorithm. Only choice (A) gives a binary
search tree of height 5.
40. (C) The choice (C) gives the following binary search tree in which both in order and preorder traversals are same.
The sequence should always be in increasing or decreasing order to get such property.






41. (D) At least 2 edges should have same weight to get multiple minimum spanning trees. Here we are not adding
any duplicate weighted edge to the graph. So it is not possible to get more than one minimal spanning tree.
42. (B) According to the binary search tree the left child value should always be less than root node value and the
right node value should always be greater than the root node. So, the tree should be visited in in-order to get
the numbers in ascending order.
43. (C) Just see any data structure book. Both the operations can be done in O(1) time.
44. (C) Lets say we have 3 colors namely R, G and B.






45. (A) Follow the heap insertion algorithm and do an in-order traversal on the constructed heap.
46. (B) Run the Dijkstas algo to get the answer.
47. (B) In the for loop the least significant `1 in `number becomes `0 for each iteration. So it counts the number of
`1s in `number.
48. (B) The program does a simple `pre-order traversal on the graph. The `value is incremented whenever both left
and right child are NULL. So, the program finds out the number of leaves in the given graph.
49. (A) There is no condition while swapping the links. So it swaps the left and right children of every node.
50. (D)
51. (A) The write happened in function `f gets destructed as soon as the function call is over. So, it prints the previous
value of `GATE.
52. (B)
53. (C) The function corresponds to the recursive equation
1
1.
n n
f f

+ By solving this we get O(n),
54. (A) To have a FA to check for divisibility by two we should have two states. To check for the divisibility by 3 we
need 3 states. In the final FSM the states consist of the combination of FSM1, and FSM2. So the final FSM
would have 6 states.

1
2
3
5
7
8
R
B
R
G
B
G
and
||Tcst ID: 00 A!! India FREE Mnck GATE Tcst uuu.guteforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 4 of 6
55. (B) State S4 denotes `odd number of as and even number of bs.
S3 - odd number of as and odd number of bs.
S2 - even number of as and odd number of bs.
S1 - even number of as and even number of bs.
So both S2 and S4 should be marked as final to accept the given language.
56. (B) The given grammar generates the following regular expression ( ) 0011 .
+
So L is regular but not ( )
*
0 1 +
57. (C) The first choice has . In the second choice the rule S AcB is not compliant to CNF
58. (A) The given CFG defines a palindrome
59. (A)
60. (C) See the first chapter of `unix operating system design by Bach.
61. (B) This is the order in which the jobs are processed.
J1 J1 J1 J3 J4 J4 J2 J2 J2
So the average waiting time is =
0 1 1 5
1.75
4
+ + +

62. (B)









Both p+d = 32 and f+d=17 as 128 MB of physical memory is there. In this `d takes 11 bits as page size is 2
kB. So p becomes 21 and f becomes 6. with these parameters the page table size becomes
21 6 21
2 2 bits 2 2 bytes 4MB
63. (A) Initial configuration


When `1 comes `4 becomes the LFU page. So we replace it with (1).





Here for 7, 6 is replaced


64. (A) When clock pulse = 1
1 Q and Q =1
when clock pulse = 0, the previous values of Q and Q are retained. So, Q = 1 Q
65. (C) Truth table

w x y z A
0 0 0 0 0
0 0 0 1 0
0 1 1 1 1
1 0 1 1 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
4 8 2 3
1 8 2 3
6 8 2 3
7 8 2 3
CPU p d f d
Logical address Physical address
Physical
memory
Page
Table
||Tcst ID: 00 A!! India FREE Mnck GATE Tcst uuu.guteforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 5 of 6
For all other values it is `0. Solve it using Karnaugh map to get a Boolean equation. Then the number of min-
terms and the number of complements gives the required number of gates.
66. (C)








67. (B) The output of D-flip-flop should be `1 if P = 0 and X = 1. So the flip flop should be reset, i.e. P = 0 and TRST
= 0 to get a `0 on X.
68. (B)
69. (A) The output of OR gate comes out as ( ) 0,1,3,5, 6,7

. The negation of this gives us ( ) 2, 4 .

The output of
AND gate should be the common min-terms between ( ) 2, 4

and ( ) 1, 4,5

which is = ( ) 4 .


70. (A) If J and K are tied to `1 then the output is always complemented. When CP is triggered A1 becomes 0. This
triggers the second flipflop as CP is going from 0 to 1. The other flip flops are also triggered in the similar
fashion. So the output is 1000.
71. (A) If we have to prove that it is a contradiction then ( ) ( ) p r q r ]
]
should be true and ( ) p q r ]
]
should
be false. Then only the given preposition become false. In all other cases it is true according to the definition
of " operator. Let us take ( ) ( ) p r q r ]
]
as preposition (1) and ( ) p q r ]
]
as preposition (2).
Preposition (2) is false only if

( ) ( )
( )
3
4
p q T
r F


Preposition (1) is true only if ( ) ( ) and p r q r both are true. But r is false according to the equation (4).
So p and q both should be false to make ( ) ( ) and p r q r True which doesnt satisfy equation (3). So the
given preposition is a tautology.
72. (B) The correct translation is:
( ) ( ) ( ) ( ) connected bipartite planar x x x x ]
]

however, the above one could be written as

( ) ( ) ( )
( ) ( ) ( ) ( )
connected bipartite planar
as
x x x x
x p x q x x p x q x
]
]
] ]
] ]


73. (C) Let us take some samples which satisfy the given binary relation. They are ( ) ( ) ( ) { 0,1 , 1,2 , 2, 3 ,
The symmetric closure of this is ( ) ( ) ( ) ( ) ( ) ( ) { 0,1 , 1, 0 , 1,2 , 2,1 , 2, 3 , 3, 2 ,
The above samples satisfy the equation
( ) { {
, 1 and , 0,1, 2, x y y x x y t completely.
74. (B) See any discrete mathematics text book.
75. (B)

( )
( )
( )
1
1
1 2
2
2 3
1
1 0
0 1 2 2 1
1
1
3
3
3
3
3 3 3 3 3 3
1 3 1
3 1
2 2
n
n n
n
n n
n
n n
n n n
n
n
n
a a
a a
a a
a a
a



+
+
+
+
+
+
+ + + + + +


76. (B)
77. (B)
O
R
T
f
x
y
z
21
MUX
||Tcst ID: 00 A!! India FREE Mnck GATE Tcst uuu.guteforum.com
All rights reserved by GATE Forum Educational Services Pvt. Ltd. No part of this booklet may be reproduced or utilized in any form without the
written permission. Discuss this questions paper at www.gateforum.com. Page 6 of 6
78. (A) Both the decompositions should have primary key to make it lose less.
79. (A)
80. (B)
81.(a) (B) Two stacks are needed.
81.(b) (A) Enqueue operation is done by the PUSH operation on stack 1. Dequeue is done by popping all elements on to
STACK 2 and then returning the top element. All the elements have to be moved back to STACK1 to retain
correct state. We can think of reducing the number of element movements. But it can never be less than n. so
enqueue takes O(1) time and dequeue takes O(n) time.
82.(a) (C) If we write P(T) then x or y should have p(s). in any case there is a chance that process p acquires s and waits
for T. And, process Q acquires T and waits for S in which case the deadlock occurs. Similar is the case with
p(U). If it is P(S) then only one of P or Q can acquire it and proceed further.
82.(b) (B) can be P(T), P(U) or P(U), P(T)
83.(a) (B) The program basically counts the number of 1s in A which is nothing but the sum of all bits in A0.
83.(b) (B) All bits are shifted left through carry except the last bit. So last bit should also be shifted through carry to
retain its initial value.
84.(a) (A) There are 6-bits for subnet, but we have to remove the first and last combinations for both subnet and host
ids.
84.(b) (A) 130.50. .

In this 16 the first 6 are for subnet address and the remaining 10 are for host ids. We shouldnt take the
first combination of 130.50.
binary
00000000.00000000


So the second choice is 130.50.
both are in binary
00000100.00000001


So the first subnet address is 130.50.4.1 and the 4
th
subnet address is 130.50.00010000.00000001 which
is nothing but 130.50.16.1.
85.(a) (A) As the roll number is a primary key it is different for all entries in both student and enroll databases, so the
join is always the minimum of both the tables entries.
85.(b) (B) Here course number is not a primary key. So there could be a chance that course number is same for all the
entries in both the tables which gives us the maximum value of 120. If it is distinct as in (a) then it gives the
minimum of 30.















8 bits
8 bits

You might also like