1
GATE CSE 2007
MCQ (Single Correct Answer)
+1
-0.3
Consider the following segment of C-code:
int j, n;
j=1;
while(j <= n)
 j = j * 2;
The number of comparisons made in the execution of the loop for any n > 0 is:
A
$$\left\lceil {{{\log }_2}n} \right\rceil + 1$$
B
n
C
$$\left\lceil {{{\log }_2}n} \right\rceil $$
D
$$\left\lfloor {{{\log }_2}n} \right\rfloor + 1$$
2
GATE CSE 2007
MCQ (Single Correct Answer)
+1
-0.3
Consider the DAG with $$V = \{1,2,3,4,5,6\}$$, shown below. GATE CSE 2007 Algorithms - Searching and Sorting Question 38 English Which of the following is NOT a topological ordering?
A
1 2 3 4 5 6
B
1 3 2 4 5 6
C
1 3 2 4 6 5
D
3 2 4 1 6 5
3
GATE CSE 2007
MCQ (Single Correct Answer)
+1
-0.3
Which of the following sorting algorithms has the lowest worst-case complexity?
A
Merge sort
B
Bubble sort
C
Quick sort
D
Selection sort
4
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
What is the time complexity of the following recursive function?
int DoSomething(int n){
 if(n <= 2)
     return 1;
 else
     return (floor(sqrt(n)) + n);
}
A
$$\Theta \,({n^2})$$
B
$$\Theta \,(n\,{\log _2}\,n)$$
C
$$\Theta \,({\log _2}\,n)$$
D
$$\Theta \,({\log _2}\,{\log _2}\,n)$$
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12