Test on time complexity
Casual Mode - Take your time!
1 / 8
Correct
0
Incorrect
0
Score
0%
Multiple Choice
What is time complexity of fun()?
int fun(int n)
{
int count = 0;
for (int i = 0; i < n; i++)
for (int j = i; j > 0; j--)
count = count + 1;
return count;
}
- $\theta(n^2)$
- $\theta(nlogn)$
- $\theta(n)$
- $\theta(logn)^2$