The GATE Grind

GATE 2007 CS – Question 45

Algorithms · Asymptotic Analysis and Time/Space Complexity · 2 marks · Multiple choice

Find the time complexity.

int DoSomething(int n) {
 if(n<=2) return 1;
 return DoSomething(floor(sqrt(n)))+n;
}
  1. $\Theta(n^2)$
  2. $\Theta(n\log_2n)$
  3. $\Theta(\log_2n)$
  4. $\Theta(\log_2\log_2n)$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) $\Theta(\log_2\log_2n)$

Explanation

We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort

More Asymptotic Analysis and Time/Space Complexity questions

All Asymptotic Analysis and Time/Space Complexity questions →