How to solve the recurrence T(n) = 2T(n^(1/2)) + log n?

Waqas picture Waqas · Oct 27, 2012 · Viewed 15.4k times · Source

I am trying to find the time complexity for the recurrence:

T(n) = 2T(n1/2) + log n

I am pretty close to the solution, however, I have run into a roadblock. I need to solve:

n(1/2k) = 1

for k to simplify my substitution pattern. I am not looking for answers to the recurrence, just a solution for k.

Answer

Salvador Dali picture Salvador Dali · Dec 15, 2015

When you start unrolling the recursion, you get: enter image description here


Here the same thing with a few additional steps:

enter image description here

Now using the boundary condition for a recursion (number 2 selected as 0 and 1 do not make sense), you will get:

enter image description here

Substituting k back to the equation you will get:

enter image description here

Here are a couple of recursions that use the same idea.