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;
}
  1. $\theta(n^2)$
  2. $\theta(nlogn)$
  3. $\theta(n)$
  4. $\theta(logn)^2$
Change Mode