Bubi
Bubi

Reputation: 27

Solving a Recurrence relation formula with squared

I Hope someone Can help me with that: enter image description here

I will be asked to answer what is the runtime complexity of the algorithm. I tried to set m=2^ and still failed Thanks

Upvotes: 0

Views: 61

Answers (1)

Matt Timmermans
Matt Timmermans

Reputation: 59358

Let n = 2x

Then T(2x) = T(2√x) + 1

Let U(x) = T(2x), so:

U(x) = U(√x)+1

We assume there is a base case, so U(x) ∈ O(log log x)

Substituting back:

T(2x) ∈ O(log log x)

T(n) ∈ O(log log log n)

Upvotes: 1

Related Questions