Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE CS 2020 | Question 12

  • Difficulty Level : Medium
  • Last Updated : 26 May, 2021

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
Recommended Articles
Page :

Start Your Coding Journey Now!