CS - 2010 - by WWW - Learnengineering.in
CS - 2010 - by WWW - Learnengineering.in
in
No part of this publication may be reproduced or distributed in any form or any means, electronic, mechanical,
photocopying, or otherwise without the prior permission of the author.
n
n g.i
GATE SOLVED PAPER
Computer Science Engineering
2010
e eri
gin
Copyright © By NODIA & COMPANY
En
arn
Information contained in this book has been obtained by authors, from sources believes to be reliable. However,
neither Nodia nor its authors guarantee the accuracy or completeness of any information herein, and Nodia nor its
authors shall be responsible for any error, omissions, or damages arising out of use of this information. This book
is published with the understanding that Nodia and its authors are supplying information but are not attempting
.Le
www.LearnEngineering.in
www.LearnEngineering.in
Q. 1 Two alternative package Aand B are available for processing a database having
10k records. Package A requires 0.0001 n2 time units and package B requires 10
n log 10 n time units to process n records. What is the smallest value of k for which
n
package B will be preferred over A ?
(A) 12 (B) 10
g.i
(C) 6 (D) 5
n
a 0 a1 /2 +. a/n 1- 2n 1-+
. A subsequence of a sequence is obtained by deleting
eri
some elements form the sequence, keeping the order of the remaining elements the
same. Let X denote the maximum possible weight of a subsequence of a 0, a1, . an 1-
and Y the maximum possible weight of a subsequence of a1, a2, . , an 1-. Then X
is equal to
e
(A) max (Y, a 0 Y+) (B) max (Y, a 0 Y +/2)
gin
(C) max (Y, a 0 2+Y) (D) a 0 Y+/2
Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij in
the matrix W below is the weight of the edge {i, j} .
J0 1 8 1 4N
arn
K O
K1 0 12 4 9O
W K=8 12 0 7 3O
K O
K1 4 7 0 2O
K4 9 3 2 0O
.Le
L P
Q. 3 What is the minimum possible weight of a spanning tree T in this graph such that
vertex 0 is a leaf node in the tree T ?
(A) 7 (B) 8
w
(C) 9 (D) 10
ww
www.LearnEngineering.in
www.LearnEngineering.in
n
Q. 8 One of the header fields in an IP datagram is the Time-to-Live (TTL) field.
Which of the following statements best explains the need for this field ?
g.i
(A) It can be used to prioritize packets
(B) It can be used to reduce delays
n
(C) It can be used to optimize throughput
(D) It can be used to prevent packet looping
Q. 9
(A) Internet chat
(C) E-mail
e eri
Which one of the following is not a client-server application ?
(B) Web browsing
(D) Ping
gin
Q. 10 Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91
respectively and they both use the same netmask N. Which of the values of N
given below should not be used if A and B should belong to the same network ?
(A) 225.255.255.0
En
(B) 255.255.255.128
(C) 255.255.255.192
arn
(D) 255.255.255.224
Consider a network with 6 routers R1 and R6 connected with links having weights
as shown in the following diagram.
w
ww
Q. 11 All the routers use the distance vector based routing algorithm to update their
routing tables. Each starts with its routing table initialized to contain an entry
for each neighbour with the weight of the respective connecting link. After all
the routing tables stabilize, how many links in the network will never be used for
carrying any data ?
(A) 4 (B) 3
(C) 2 (D) 1
www.LearnEngineering.in
www.LearnEngineering.in
Q. 12 Suppose the weights of all unused links in the previous question are changed to 2
and the distance vector algorithm is used again until all routing tables stabilize.
How many links will now remain unused ?
(A) 0 (B) 1
(C) 2 (D) 3
n
unit is
(A) 100 nanoseconds
g.i
(B) 100)210 nanoseconds
(C) 100)220 nanoseconds
n
(D) 3200)220 nanoseconds
eri
Q. 14 A-5 stage pipelined processor has Instruction Fetch. (IF), Instruction Decode
(ID), Operand Fetch (OF), Perform Operation (PO) and Write Operand (WO)
stages. The IF, ID, OF and WO stages take 1 clock cycle each for any instruction.
e
The PO stage takes 1 clock cycle for ADD and SUB instruction. The PO stage
takes 1 stake clock cycle for ADD and SUB instructions 3 clock cycles for
gin
MUL instruction, and 6 clock cycles for DIV instruction respectively. Operand
forwarding is used in the pipeline. What is the number of clock cycles needed to
execute the following sequence of instructions ?
Instruction Meaning of instruction
En
d a =b +
e c =d +
ww
f c =e +
b c =e +
e b =f +
d 5 =e +
Assuming that all operations take their operands from register, what is the
minimum number of registers needed to execute this program without spilling ?
(A) 2 (B) 3
(C) 4 (D) 6
www.LearnEngineering.in
www.LearnEngineering.in
n
Q. 16 When there is a miss in L1 cache and a hit in L2 cache, a block is transferred form
g.i
L2 cache to L1 cache. What is the time taken for this transfer ?
(A) 2 nanoseconds (B) 20 nanoseconds
(C) 22 nanoseconds (D) 88 nanoseconds
n
Q. 17 When there is a miss in both L1 cache and L2 cache, first a block is transferred
eri
from memory to L2 cache, and then a block is transferred from L2 cache to L1
cache. What is the total time taken for these transfers ?
(A) 222 nanoseconds (B) 888 nanoseconds
e
(C) 902 nanoseconds (D) 968 nanoseconds
gin
+
Q. 18 Consider a B -tree in which the maximum number of keys in a node is 5. What
is the minimum number of keys in any non-root node?
(A) 1 (B) 2
En
(C) 3 (D) 4
0 ‘Sachin’ 65
1 ‘Rahul’ 66
2 Sourav’ 67
w
3 ‘Anil’ 69
Table : Reservation
ww
www.LearnEngineering.in
www.LearnEngineering.in
SELECT pid
FROM Reservation
WHERE class= ‘AC’ AND
EXISTS (SELECT)
FROM Passenger
WHERE age>65 AND
Passenger.pid = Reservation.pid)
n
Q. 20 Which of the following concurrency control protocols ensure both conflict
g.i
serializability and freedom from deadlock?
I. 2-phase locking
II Time-stamp ordering
n
(A) I only (B) II only
eri
(C) Both I and II (D) Neither I nor II
Read (X)
Write (X)
Which one of the schedules below is the correct serialization of the above ?
arn
Q. 22 The following functional dependencies hold for relations R(A,B,C) and S(B,D,E):
.Le
B"A
A"C
The relation R contains 200 tuples and the relation S contains 100 tuples. What
is the maximum number of tuples possible in the natural join R D S ?
w
(A) 100
(B) 200
ww
(C) 300
(D) 2000
www.LearnEngineering.in
www.LearnEngineering.in
Q. 25 The Boolean expression for the output f of the multiplexer shown below is
(A) P 5 Q 5 R (B) P 5 Q 5 R
n
(C) P Q +R + (D) P Q +R +
g.i
Q. 26 What is the boolean expression for the output f of the combinational logic circuit
of NOR gates given below ?
n
e eri
gin
En
(A) Q +
R (B) P +
Q
(C) P +
R (D) P Q +R +
arn
Q. 27 In the sequential circuit shown below, if the initial value of the output Q1 Q 0 is 00,
what are the next four values of Q1 Q 0 ?
w .Le
www.LearnEngineering.in
www.LearnEngineering.in
n
2-
(A) 0 (B) e
(C) (n 1-) /2 (D) 1
g.i
Q. 33 In a binary tree with n nodes, every node has an odd number of descendants.
Every node is considered to be its own descendant. What is the number of nodes
n
in the tree that have exactly one child ?
(A) 0 (B) 1
Q. 34
(C) (n 1-) /2
eri(D) n 1-
Q. 36 The degrees sequence of a simple graph is the sequence of the degrees of the nodes
in the graph in decreasing order. Which of the following sequence can not be the
.Le
III 7, 6, 6, 4, 4, 3, 2, 2
IV 8, 7, 7, 6, 4, 2, 1, 1
ww
www.LearnEngineering.in
www.LearnEngineering.in
Q. 38 Suppose the predicate F (x, y, t) is used to represent the statement that person x
can fool person y at time t .Which one of the statements below expresses best the
meaning of the formula 6x7y7t (JF (x, y, t)) ?
(A) Everyone can fool some person at some time
(B) No one can fool everyone all the time
(C) Everyone cannot fool some person all the time
(D) No one can fool some person at some time.
Q. 39 Consider the methods used by processes P1 and P2 for accessing their critical
sections whenever needed, as given below. The initial values of shared boolean
n
variables S1 and S2 are randomly assigned.
g.i
Method used by P1 Method used by P2
While (S1==S2); While (S1!=S2);
Critical Section Critical Section
n
S1=S2; S2=not (S1)
eri
While one of the following statements describes properties achieved ?
(A) Mutual exclusion nut nor progress
(B) Progress but not mutual exclusion
e
(C) Neither mutual exclusion nor progress
gin
(D) Both mutual exclusion and progress
Q. 40 A system uses FIFO policy for page replacement. It has 4 page frames with no
pages loaded to begin with . The system first accesses 100 distinct pages in some
order and then accesses the same 100 pages but now in the reverse order .How
En
www.LearnEngineering.in
www.LearnEngineering.in
n
In which one of the following situations is a deadlock possible ?
g.i
(A) n 40, k = 26 =
(B) n 21, k = 12 =
(C) n 20, k = 10 =
n
(D) n 41, k = 19 =
Q. 44
eri
The cyclomatic complexity of each of the modules A and B shown below is 10.
What is the cyclomatic complexity of the sequential integration shown on the
right hand side ?
e
gin
En
arn
(A) 19
(B) 21
(C) 20
.Le
(D) 10
)
p = 2;
}
int i=0,j=1;
int main(){
f(&i,&j);
printf(“%d%d\n”,i,j);
return 0;
}
(A) 22 (B) 21
(C) 01 (D) 02
www.LearnEngineering.in
www.LearnEngineering.in
Q. 46 What is the appropriate paring of items in the two columns listing various
activities encountered in a software life cycle ?
P. Requirement Capture 1. Module Development and Integration
Q. Design 2. Domain Analysis
R. Implementation 3. Structural and Behavioral Modeling
S. Maintenance 4. Performance Tuning
(A) P-3 Q-2, R-4 S-1 (B) P-2 Q-3 R-1 S-4
(C) P-3 Q-2 R-1 S-4 (D) P-2 Q-3 R-4 S-1
n
Q. 47 What is the value printed by the following C program ?
#include<stdio.h>
g.i
int f(int *a, int n)
{
if (n<=0) return 0;
n
else if (*a%2==0) return *a+f(a+1,n-1);
eri
else return *a-f(a+1,n-1);
}
int main()
{
e
int a[]={12, 7, 13, 4, 11, 6};
gin
printf(“%d”,f(a,6));
return 0;
}
(A) 9- (B) 5
En
(C) 15 (D) 19
the list by moving the last element to the front of the list and returns the modified
list. Some part of the code is left blank.
typedef struct node {
int value;
.Le
if((head==NULL)<(head->next==NULL))return head;
q=NULL;p=head;
ww
while(p->next!=NULL){
q=p;
p=q->next;
}
________________________
return head;
}
Choose the correct alternative to replace the blank line.
(A) q=NULL;p->next=head;head=p;
(B) q->next=NULL;head=p;p->next=head;
(C) head=p;p->next=q;q->next=NULL;
(D) q->next=NULL;p-next=head;head=p;
www.LearnEngineering.in
www.LearnEngineering.in
n
T1 : a,b,c and d are all equal
T2 : a,b,c and d are all distinct
g.i
T3 : a=b and c!
T4 : a!=b and c=d
Which of the test suites given below ensures coverage of statements S1, S2, S3
n
and S4 ?
eri
(A) T1, T2, T3
(B) T2, T4
(C) T3, T4
e
(D) T1, T2, T4
gin
and linear probing. After inserting 6 values into an empty has table, the table is
as shown below.
0
arn
1
2 42
3 23
.Le
4 34
5 52
6 46
7 33
w
8
9
ww
Q. 50 Which one oft he following choices gives a possible order in which the key values
could have been inserted in the table ?
(A) 46, 42, 34, 52, 23, 33 (B) 34, 42, 23, 52, 33, 46
(C) 46, 34, 42, 23, 52, 33 (D) 42, 46, 33, 23, 34, 52
Q. 51 How many different insertion sequences of the key values using hte same hash
function and linear probing will result in the hash table shown above ?
(A) 10 (B) 20
(C) 30 (D) 40
www.LearnEngineering.in
www.LearnEngineering.in
n
(C) 0)(10)1))0) (D) 0)1 (10)1))10)
g.i
Q. 54 Consider the language L1 {0i 1 j i Y= j}, L2 {0i 1 j i ==j}, L3 {0i 1 j i ==2j 1} =
L4 {0i 1 j i Y= 2j}.Which one of =
the following statements is true ?
(A) Only L2 is context free (B) Only L2 and L3 are context free
n
(C) Only L1 and L2 are context free (D) All are context free
Let w
eri
by any string of length n in{0, 1}). Let L be the set of all substring so . w
Q. 55
What is the minimum number of states in a non-deterministic finite automation
that accepts L ?
e
(A) n 1- (B) n
gin
(C) n 1+ (D) 2n 1+
Q. 56 Choose the most appropriate word from the options given below to the complete
the following sentence:
His rather casual remarks on politics _____ his lack of seriousness about the
arn
subject.
(A) masked (B) belied
(C) betrayed (D) suppressed
.Le
Q. 58 Choose the most appropriate word from the options given below to complete the
following sentence:
ww
Q. 59 25 persons are in a room. 15 of them play hockey, 17 of them play football and
10 of them play both hockey and football. Then the number of persons playing
neither hockey nor football is:
(A) 2 (B) 17
(C) 13 (D) 3
www.LearnEngineering.in
www.LearnEngineering.in
Q. 60 The question below consists of a pair of related words followed by four pairs of
words. Select the pair that best expresses the relation in the original pair.
Unemployed : Worker
(A) fallow : land (B) unaware : sleeper
(C) wit : jester (D) renovated : house
n
(A) 534 (B) 1403
(C) 1623 (D) 1513
g.i
Q. 62 Hari (H), Gita (G), Irfan (I) and Saira (S) are siblings (i.e. brothers and sisters).
All were born on 1st january. The age difference between any two successive
n
siblings (that is born one after another) is less than 3 years. Given the following
facts:
eri
I. Hari’s agae + Gita’s age > Irfan’s age + Saira’s age
II. The age difference between Gita and Saira is 1 year. However Gita is not
the oldest and Saira is not the youngest.
III. There are no twins.
e
gin
In what order were they born (oldest first)?
(A) HSIG (B) SGHI
(C) IGSH (D) IHSG
En
Q. 63 5 skilled workers can build a wall in 20 days: 8 semi-skilled workers can build a
wall in 25 days; 10 unskilled workers can build a wall in 30 days. If a team has 2
skilled, 6 semi-skilled and 5 unskilled workers, how long will it take to build the
arn
wall?
(A) 20 (B) 18
(C) 16 (D) 15
.Le
Q. 64 Modern warfare has changed from large scale clashes of armies to suppression of
civilian populations. Chemical agents that do their work silently appear to be
suited to such warfare; and regretfully, there exist people in military establishments
who think that chemical agents are useful tools for their cause.
w
Which of the following statements best sums up the meaning of the above passage:
(A) Modern warfare has resulted in civil strife
ww
**********
www.LearnEngineering.in
www.LearnEngineering.in
ANSWER KEY
2010
1 2 3 4 5 6 7 8 9 10
() () () () (B) (C) (C) (D) (D) (D)
11 12 13 14 15 16 17 18 19 20
(C) (B) (D) (C) (B) (D) (D) (B) (C) (B)
21 22 23 24 25 26 27 28 29 30
(A) (A) (A) (A) (B) (A) (A) () () ()
n
31 32 33 34 35 36 37 38 39 40
g.i
() () () () () () () () (A) (A)
41 42 43 44 45 46 47 48 49 50
(D) (A) (B) (D) (A) (B) (C) (D) (D) (C)
n
51 52 53 54 55 56 57 58 59 60
(C)
61
()
(B)
62
()
(B)
63
()
(D)
64
()
(C)
65
()
e ()
eri
() () () ()
gin
En
arn
w .Le
ww
www.LearnEngineering.in