Q20
Consider the equality and the following choices for
The equality above remains correct if is replaced by
The equality above remains correct if is replaced by
Show answer without attempting
Answer: C
GATE CS · Algorithms · 7 questions
7 Algorithm Analysis questions from GATE CS papers (2015), each with the official answer key. Part of Algorithms. Answer any question right here and it is marked straight away, or practise them one at a time.
Answer: C
Answer: B
Answer: D
Answer: B
Answer: A
int fun1(int n) {
int i, j, k, p, q = 0;
for (i = 1; i < n; ++i) {
p = 0;
for (j = n; j > 1; j = j/2)
++p;
for (k = 1; k < p; k = k*2)
++q;
}
return q;
}Answer: D
Answer: D
0/70 correct0 marks