📚 Practice Mode
Test on time complexity
Learn at your own pace with hints and detailed explanations
1 / 8
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$