GATE CS 2013,Q31: Consider the following function:int unknown(int n){ int i, j, k=0; for (i=n/2; i

preview_player
Показать описание
GATE CS 2013,Q31: Consider the following function:
int unknown(int n){
int i, j, k=0;
for (i=n/2; i≤n; i++)
for (j=2; j ≤ n; j=j*2)
k = k + n/2;
return (k);
}
The return value of the function is
(A) Θ(n^2) (B) Θ(n^2log n) (C) Θ(n^3) (D) Θ(n^3logn)
Ans : (B) Θ(n2log n)
----------------------------------------------------
----------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------------
-------------------------------------------------------------------
-----------------------------------------------------------------------
#Algorithm#GATE_CSE#GATECS2013#GATECSEPYQ
Рекомендации по теме
Комментарии
Автор

Thankyou so much for this series ma'am! Best explanations to PYQ's I've found thus far, and it's very helpful with gate just around the corner!

kitpuos