Question

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

Choose every correct option
Official answer and solution
Official answer
A and B
From
Official GATE 2026 answer key

Solution

Solve each recurrence relation using telescoping sums or the Master Theorem.

Evaluating each option:

  • (A) T(n)=T(n−1)+1T(n) = T(n-1) + 1 with T(1)=1T(1) = 1 unrolls to T(n)=n=Θ(n)T(n) = n = \Theta(n).
  • (B) T(n)=2T(n/2)+1T(n) = 2T(n/2) + 1: by the Master Theorem (a=2,b=2,nlog⁡ba=na=2, b=2, n^{\log_b a} = n, f(n)=1=O(n1−ϵ)f(n) = 1 = O(n^{1-\epsilon})), T(n)=Θ(n)T(n) = \Theta(n).
  • (C) T(n)=2T(n/2)+nT(n) = 2T(n/2) + n gives T(n)=Θ(nlog⁡n)T(n) = \Theta(n \log n).
  • (D) T(n)=T(n−1)+nT(n) = T(n-1) + n gives T(n)=n(n+1)2=Θ(n2)T(n) = \frac{n(n+1)}{2} = \Theta(n^2).

Therefore, (A) and (B) have time complexity Θ(n)\Theta(n).

Final answer

Options (A), (B)

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2026 Computer Science and Information Technology - Session 2 (CS2)
Question
25 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.