1
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C - function:
double foo(int n){
 int i;
 double sum;
 if(n == 0) return 1.0;
 sum = 0.0;
 for (i = 0; i < n; i++){
  sum += foo(i);
 }
 return sum;
}
Suppose we modify the above function foo() and store the values of foo(i), $$0 \le i \le n$$, as and when they are computed. With this modification, the time complexity for function foo() is significantly reduced. The space complexity of the modified function would be:
A
O(1)
B
O(n)
C
O(n2)
D
O(n!)
2
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is given below:
10, 8, 5, 3, 2
Two new elements '1' and '7' are inserted in the heap in that order, The level order traversal of the heap after the insertion of the elements is:
A
10, 8, 7, 5, 3, 2, 1
B
10, 8, 7, 2, 3, 1, 5
C
10, 8, 7, 1, 2, 3, 5
D
10, 8, 7, 3, 2, 1, 5
3
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C - function:
double foo(int n){
 int i;
 double sum;
 if(n == 0) return 1.0;
 sum = 0.0;
 for (i = 0; i < n; i++){
  sum += foo(i);
 }
 return sum;
}
The space complexity of the above function is:
A
O(1)
B
O(n)
C
O(n!)
D
O(nn)
4
GATE CSE 2005
MCQ (Single Correct Answer)
+2
-0.6
Suppose there are $$\lceil \log n \rceil$$ sorted lists of $$\left\lfloor {{n \over {\log n}}} \right\rfloor $$ elements each. The time complexity of producing a sorted list of all these elements is :
(Hint : Use a heap data structure)
A
$$O(n \log \log n)$$
B
$$\Theta(n \log n)$$
C
$$\Omega(n \log n)$$
D
$$\Omega\left(n^{3/2}\right)$$
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12