Skip to content
Official PYQ · 2026

GATE CS 2026 Set 1 Q7 — Asymptotic Worst Case Time and Space Complexity

Explain with AI

Consider the following recurrence relations:

For all n>1n>1,
T1(n)=4T1(n2)+T2(n)T2(n)=5T2(n4)+Θ(log⁡2n)\begin{array}{c} T_{1}(n)=4 T_{1}\left(\frac{n}{2}\right)+T_{2}(n) \\ T_{2}(n)=5 T_{2}\left(\frac{n}{4}\right)+\Theta\left(\log _{2} n\right) \end{array}
Assume that for all n≤1,T1(n)=1n \leq 1, T_{1}(n)=1 and T2(n)=1T_{2}(n)=1.

Which one of the following options is correct?

Choose one option
View worked solution

Answer: A

To find the asymptotic complexity of T1(n)T_1(n), we solve the recurrence relations step-by-step using the Master Theorem.

Step 1: Solve for T2(n)T_2(n)

The recurrence relation for T2(n)T_2(n) is given by:

T2(n)=5T2(n4)+Θ(log⁡2n)T_2(n) = 5 T_2\left(\frac{n}{4}\right) + \Theta(\log_2 n)

Comparing this with the standard Master Theorem form T(n)=aT(n/b)+f(n)T(n) = a T(n/b) + f(n):

  • a=5a = 5
  • b=4b = 4
  • f(n)=Θ(log⁡2n)f(n) = \Theta(\log_2 n)

We compare f(n)f(n) with nlog⁡ban^{\log_b a}:

nlog⁡ba=nlog⁡45≈n1.16n^{\log_b a} = n^{\log_4 5} \approx n^{1.16}

Since f(n)=Θ(log⁡2n)=O(nlog⁡45−ϵ)f(n) = \Theta(\log_2 n) = O(n^{\log_4 5 - \epsilon}) for any 0<ϵ<0.160 < \epsilon < 0.16, this falls under Case 1 of the Master Theorem. Therefore:

T2(n)=Θ(nlog⁡45)T_2(n) = \Theta\left(n^{\log_4 5}\right)

Step 2: Solve for T1(n)T_1(n)

Now, substitute the asymptotic behavior of T2(n)T_2(n) into the recurrence relation for T1(n)T_1(n):

T1(n)=4T1(n2)+Θ(nlog⁡45)T_1(n) = 4 T_1\left(\frac{n}{2}\right) + \Theta\left(n^{\log_4 5}\right)

Comparing this with the Master Theorem form:

  • a=4a = 4
  • b=2b = 2
  • f(n)=Θ(nlog⁡45)f(n) = \Theta\left(n^{\log_4 5}\right)

We compare f(n)f(n) with nlog⁡ban^{\log_b a}:

nlog⁡ba=nlog⁡24=n2n^{\log_b a} = n^{\log_2 4} = n^2

Since log⁡45≈1.16<2\log_4 5 \approx 1.16 < 2, we have:

f(n)=Θ(nlog⁡45)=O(n2−ϵ)for 0<ϵ<0.84f(n) = \Theta\left(n^{\log_4 5}\right) = O\left(n^{2 - \epsilon}\right) \quad \text{for } 0 < \epsilon < 0.84

This also falls under Case 1 of the Master Theorem. Therefore:

T1(n)=Θ(n2)T_1(n) = \Theta\left(n^2\right)

Thus, the correct option is A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Asymptotic Worst Case Time and Space Complexity questions