GATE | GATE CS 2020 | Question 12

For parameters a and b, both of which are ω(1), T(n)=T(n1/a)+1, and T(b)=1. Then T(n) is
(A) Θ(logalogbn)
(B) Θ(logabn)
(C) Θ(logblogan)
(D) Θ(log2log2n)


Answer: (A)

Explanation: Given,

T(n) = T(n1/a)+1, 
T(b) = 1 

Now, using iterative method,

= T(n) 
= [T(n1/a2)+1] + 1
= [T(n1/a3)+1] + 2
= [T(n1/a4)+1] + 3
.
.
.
= [T(n1/ak)+1] + (k-1)
= T(n1/ak) + k 

Let,

→ n1/ak = b
→ log(n1/ak) = log(b)
→ ak = log(n) / log (b) = logb(n)
→ k = logalogb(n)

Therefore,

= T(n1/ak) + k
= T(b) + logalogb(n)
= 1 + logalogb(n)
= Θ(logalogb(n)) 

Option (A) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.