GateAI
Asymptotic Analysis

GATE CSE 2026 Set 2 · Q25

MSQ1 markEasy

Time

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

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: A) T(n) = T(n - 1) + 1, T(1) = 1; B) T(n) = 2T ((n)/(2) ) + 1, T(1) = 1

Asymptotic Analysis

Let us solve each recurrence relation:

  • Option (A): T(n)=T(n−1)+1T(n) = T(n - 1) + 1 with T(1)=1T(1) = 1.

    T(n)=T(n−1)+1=T(n−2)+2=⋯=T(1)+(n−1)=1+n−1=n=Θ(n)T(n) = T(n - 1) + 1 = T(n - 2) + 2 = \dots = T(1) + (n - 1) = 1 + n - 1 = n = \Theta(n)
  • Option (B): T(n)=2T(n2)+1T(n) = 2T\left(\frac{n}{2}\right) + 1 with T(1)=1T(1) = 1. Using the Master Theorem T(n)=aT(n/b)+f(n)T(n) = aT(n/b) + f(n) where a=2,b=2,f(n)=1a = 2, b = 2, f(n) = 1:

    nlog⁡ba=nlog⁡22=n1=nn^{\log_b a} = n^{\log_2 2} = n^1 = n

    Since f(n)=1=O(n1−ϵ)f(n) = 1 = O(n^{1 - \epsilon}) for ϵ=1\epsilon = 1, by Case 1 of the Master Theorem:

    T(n)=Θ(n)T(n) = \Theta(n)
  • Option (C): T(n)=2T(n2)+nT(n) = 2T\left(\frac{n}{2}\right) + n with T(1)=1T(1) = 1. Here a=2,b=2,f(n)=n=Θ(nlog⁡22)a = 2, b = 2, f(n) = n = \Theta(n^{\log_2 2}). By Case 2 of the Master Theorem:

    T(n)=Θ(nlog⁡n)T(n) = \Theta(n \log n)
  • Option (D): T(n)=T(n−1)+nT(n) = T(n - 1) + n with T(1)=1T(1) = 1.

    T(n)=T(1)+2+3+⋯+n=n(n+1)2=Θ(n2)T(n) = T(1) + 2 + 3 + \dots + n = \frac{n(n + 1)}{2} = \Theta(n^2)

Therefore, the recurrence relations with time complexity Θ(n)\Theta(n) are (A) and (B).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Asymptotic Analysis previous year question is Q25 of the GATE CSE 2026 Set 2 paper. Find more GATE CSE PYQs on Asymptotic Analysis in Algorithms, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Asymptotic Analysis PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Asymptotic Analysis in GATE CSE

Asymptotic Analysis has 31 GATE CSE PYQs across 19 papers from 2011 to 2026. 2 of them are 1-mark MSQs like this one, and GATE CSE 2026 Set 2 has 3.

How GATE tests Asymptotic Analysis

More from GATE CSE 2026 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2026 Set 2 · Q25 · MSQ

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.