Skip to main content

GATE CSE 2024Algorithms › Growth of Functions & Complexity AnalysisVerified

GATE CSE 2024 PYQ: ​​​​​Let T(n) \text{T(n)} T(n) be the recurrence relation defined as follows: T ( 0 ) = 1 , T ( 1 ) = 2 ,…

​​​​​Let T(n)\text{T(n)} be the recurrence relation defined as follows:

T(0)=1,T(1)=2, and T(n)=5T(n−1)−6T(n−2) for n≥2 \begin{array}{l} T(0)=1, \\ T(1)=2, \text { and } \\ T(n)=5 T(n-1)-6 T(n-2) \text { for } n \geq 2 \end{array}

Which one of the following statements is TRUE?

  1. A
    T(n)=Θ(2n)T(n)=\Theta\left(2^{n}\right)
    Correct answer
  2. B
    T(n)=Θ(n2n)T(n)=\Theta\left(n 2^{n}\right)
  3. C
    T(n)=Θ(3n)T(n)=\Theta\left(3^{n}\right)
  4. D
    T(n)=Θ(n3n)T(n)=\Theta\left(n 3^{n}\right)

Answer

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

Approach

Solve the linear homogeneous recurrence using the characteristic equation, then apply initial conditions to find the exact closed form.

The recurrence has characteristic roots 2 and 3. Initial conditions force the coefficient of $3^n$ to be zero, leaving $T(n)=2^n$. Hence $T(n)=\Theta(2^n)$.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.