edited by
553 views

1 Answer

0 votes
0 votes

return $DoSomething(floor(sqrt(n)))$ + n;

=> Here '+ n' is not a function of input size n. It takes only constant time always.

So the time complexity becomes simply $T(n)$ = $T(\sqrt{n}) + c$

which you can solve either by substitution method or by Master's Theorem and can get the solution.

The solution for this relation is $\Theta (log (log n))$.

Hence, the answer is (D).

Related questions

1 votes
1 votes
0 answers
1
syncronizing asked Mar 15, 2019
1,298 views
Is this the correct way to solve ?Q) int algorithm(int n){ int sum =0;k,j; for (k=0;k<n/2;k++) for(j=0;j<10;j++) sum++; return 4*algorithm(n/2)*algorit...
1 votes
1 votes
1 answer
2
VikramRB asked Jan 20, 2019
1,042 views
What is the time complexity of the following recurrence relation and step to derive the same$T(n) = T(\sqrt{n}) + log(logn)$
0 votes
0 votes
0 answers
4
garvit_vijai asked Nov 17, 2018
467 views
How to solve the following recurrence relation?T(n) = T(n-6) + n2 , n>7T(n) = 1 , n<= 7