Please help me calculate the time complexity of the following program.
int fun (int n) {
if (n <= 2)
return 1;
else
return fun(sqrt(n)) + n;
}
Please explain.
There were four choices given.
- $\Theta(n^2)$
- $\Theta(n \log n)$
- $\Theta(\log n)$
- $\Theta(\log \log n)$