Similar questions 2 more →
Asymptotic Analysis & Recurrences

Answer & solution
Answer: D (no official key was published)
1. Approach. The function makes one recursive call, not n calls. Each square root halves the logarithm of the argument, so analyze the recursion in terms of log n.
2. Derivation and interpretation. Assuming unit-cost integer arithmetic and square root as intended, T(n)=T(floor(sqrt(n)))+Θ(1). After k reductions the argument is approximately n1/2^k, and reaches a constant when 2k=Θ(log n). Thus k=Θ(log log n), giving D. Adding n to the returned value is one arithmetic operation, not n operations; floors change only constant-level stopping details.