What is the time complexity of the following recursive function:
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
This question is part of this quiz :
Top MCQs on Complexity Analysis using Recurrence Relations with Answers