CS GATE 2010 (Test 4)



Tag: cs gate 2010
Q.1
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. Which of the following statements best sums up the meaning of the above passage:
A. Modern warfare has resulted in civil strife.
B. Chemical agents are useful in modern warfare.
C. Use of chemical agents in warfare would be undesirable
D. People in military establishments like to use chemical agents in war
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Topic: Arithmetic Tag: CS GATE 2010
Q.2
5 skilled workers can build a wall in 20days: 8 semi-skilled workers can build a wall in 25 days; 10 unskilled workers can build a wall in 30days. If a team has 2 skilled, 6 semi-skilled and 5 unskilled workers, how long will it take to build the wall? 
A. 20
B. 18
C. 16
D. 15
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.3
What is the appropriate pairing of items in the two columns listing various activities encountered in a software li fe cycle? 
P. Requirements 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
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.4
Two alternative packages A and B are available for processing a database having 10k records. Package A requires 0.0001ntime units and package B requires 10nlog10n time units to process n records. What is the smallest value of k for which package B will be preferred over A?
A. 12
B. 10
C. 6
D. 5
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Topic: Databases Tag: CS GATE 2010
Q.5
A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below 

How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above?
A. 10
B. 20
C. 30
D. 40
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.6
Consider the following schedule for transactions T1, T2 and T3: 
    T1                   T2                      T3
Read(X)
                        Read(Y)
                                                  Read(Y)
                        Write(Y)
Write(X)
                                                  Write(X)
                        Read(X)
                        Write(X)
Which one of the schedules below is the correct serialization of the above? 
A. T1 → T3 → T2
B. T2 → T1 → T3
C. T2 → T3 → T1
D. T3 → T1 → T2
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.7
The grammar S → aSa|bS|c is
A. LL(1) but not LR(1)
B. LR(1) but not LR(1)
C. Both LL(1) and LR(1)
D. Neither LL(1) nor LR(1)
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Topic: Algorithms Tag: CS GATE 2010
Q.8
What is the value printed by the following C program?
#include <stdio.h> 
int f(int * a, int n)
{
if (n <= 0)return 0;
else if(*a % 2 == 0) return * a + f(a + 1,n - 1);
else return * a - f(a + 1, n - 1);
}
int main ( )
{
int a[ ] = {12, 7, 13, 4, 11, 6};
print f ("%d", f(a, 6));
return 0;
}
A. -9
B. 5
C. 15
D. 19
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.9
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
C. 3
D. 4
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.10
The following program is to be tested for statement coverage: 
begin
if (a = = b) {S1; exit;} 
else if (c = = d) {S2;} 
else {S3; exit;}
S4; 
end
The test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a, b, c and d. The exact values are not given. 
T1 : a, b, c and d are all equal
T2 : a, b, c and d are all distinct
T3 : a=b and c !=d
T4 : a !=b and c=d
Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4? 
A. T1, T2, T3
B. T2, T4
C. T3, T4
D. T1, T2, T4
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report