Skip to main content

GATE CSE 2026Algorithms › Recursion & Recurrence RelationsVerified

GATE CSE 2026 PYQ: Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity Θ (…

Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity Θ(n)\Theta(n)?

  1. A
    T(n)=T(n−1)+1,T(1)=1T(n)=T(n-1)+1, \quad T(1)=1
    Correct answer
  2. B
    T(n)=2T(n2)+1,T(1)=1T(n)=2 T\left(\frac{n}{2}\right)+1, \quad T(1)=1
    Correct answer
  3. C
    T(n)=2T(n2)+n,T(1)=1T(n)=2 T\left(\frac{n}{2}\right)+n, \quad T(1)=1
  4. D
    T(n)=T(n−1)+n,T(1)=1T(n)=T(n-1)+n, \quad T(1)=1

Answer

(A, B) T ( n ) = T ( n − 1 ) + 1 , T ( 1 ) = 1 T(n)=T(n-1)+1, \quad T(1)=1 T ( n ) = T ( n − 1 ) + 1 , T ( 1 ) = 1; T ( n ) = 2 T ( n 2 ) + 1 , T ( 1 ) = 1 T(n)=2 T\left(\frac{n}{2}\right)+1, \quad T(1)=1 T ( n ) = 2 T ( 2 n ​ ) + 1 , T ( 1 ) = 1

Approach

For each recurrence, determine its asymptotic growth. Subtract-and-conquer recurrences can be expanded by unrolling; divide-and-conquer recurrences can be classified with the Master theorem by comparing f(n) with $n^{log_b a}$.

Options A and B both have linear asymptotic complexity Θ(n). Option C is Θ(n log n), and option D is $Θ(n^2)$. Therefore the correct choices are A and B.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.