Algorithms | Analysis of Algorithms (Recurrences) | Question 8

Last Updated :
Discuss
Comments

What is the time complexity of the following recursive function: 
 

c
int DoSomething (int n) 
{
  if (n <= 2)
    return 1;
  else  
    return (DoSomething (floor(sqrt(n))) + n);
}

(A) [Tex]\\theta   [/Tex](n) 
(B) [Tex]\\theta   [/Tex](nlogn)
(C) [Tex]\\theta   [/Tex](logn)
(D) [Tex]\\theta   [/Tex](loglogn)
 

A

B

D

C

Share your thoughts in the comments