1
$\begingroup$

I solved the question T(n) = T(sqrt(n)) + 1 but can't quit understand one step of the solutionenter image description here

I don't understand the transition in (1). how did we conclude that T(m) = T(m/2) + 1 from the previous step that m is in the power?

$\endgroup$
1
$\begingroup$

It obviously is not correct. To fix it, define $S(m)=T(2^m)$, and then we would have $S(m)=S(m/2)+1$. Now, continue with the proof replacing everywhere $T(m)$ with $S(m)$. After you solve what $S(m)$ is, substitute $m=\log(n)$ in the solution to get what $T(n)=T(2^m)=S(m)$ is.

$\endgroup$
1
  • $\begingroup$ Thanks' a lot. got the answer. didn't pay attention to the substitution of the function as well. $\endgroup$ – amin foroutan Apr 15 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.