Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity ?
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 Θ (…
- ACorrect answer
- BCorrect answer
- C
- D
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.