1
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)$$
2
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
3
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 39 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
4
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6

Consider the CFG with { S, A, B } as the non-terminal alphabet, { a, b } as the terminal alphabet, S as the start symbol and the following set of production rules:

$$\eqalign{ & S \to bA\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,S \to aB \cr & A \to a\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,B \to b \cr & A \to aS\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,B \to bS \cr & S \to bAA\,\,\,\,\,\,\,\,\,\,\,B \to aBB \cr} $$

Which of the following strings is generated by the grammar?

A
aaaabb
B
aabbbb
C
aabbab
D
abbbba
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12