Skip to main content

GATE CSE 2026Algorithms › Growth of Functions & Complexity AnalysisVerified

GATE CSE 2026 PYQ: Consider the following recurrence relations: For all n > 1 n>1 n > 1 , T 1 ( n ) = 4 T 1 ( n 2 ) + T 2 ( n )…

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?

  1. A
    T1(n)=Θ(n2)T_{1}(n)=\Theta\left(n^{2}\right)
    Correct answer
  2. B
    T1(n)=Θ(n2log⁡2n)T_{1}(n)=\Theta\left(n^{2} \log _{2} n\right)
  3. C
    T1(n)=Θ(nlog⁡45)T_{1}(n)=\Theta\left(n^{\log _{4} 5}\right)
  4. D
    T1(n)=Θ(nlog⁡45log⁡2n)T_{1}(n)=\Theta\left(n^{\log _{4} 5} \log _{2} n\right)

Answer

(A) T 1 ( n ) = Θ ( n 2 ) T_{1}(n)=\Theta\left(n^{2}\right) T 1 ​ ( n ) = Θ ( n 2 )

Approach

The two recurrences are nested: T1 calls T2. First resolve T2 with the Master Theorem to obtain its asymptotic order, then substitute that order into T1 and apply the Master Theorem a second time.

Solving the inner recurrence gives T2(n) = $Θ(n^{log_4 5})$. Feeding this into T1(n) = 4T1(n/2) + T2(n) and applying the Master Theorem with a = 4, b = 2 yields $log_2 4 = 2$ > $log_4 5$, so Case 1 applies and T1(n) = $Θ(n^2)$ — option A.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.