GateAI
Asymptotic Analysis

GATE CSE 2024 Set 1 · Q42

MCQ2 marksMedium

Time

Consider the following recurrence relation: T(n)={nT(n)+nfor n≥1,1for n=1. T(n) = \begin{cases} \sqrt{n} T(\sqrt{n}) + n & \text{for } n \ge 1, \\ 1 & \text{for } n = 1. \end{cases} Which one of the following options is CORRECT?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) T(n) = (n log log n)

Asymptotic Analysis

Given the recurrence relation for n>1n > 1:

T(n)=nT(n)+nT(n) = \sqrt{n} T(\sqrt{n}) + n

Divide both sides by nn:

T(n)n=T(n)n+1\frac{T(n)}{n} = \frac{T(\sqrt{n})}{\sqrt{n}} + 1

Define S(n)=T(n)nS(n) = \frac{T(n)}{n}. The recurrence simplifies to:

S(n)=S(n)+1S(n) = S(\sqrt{n}) + 1

To solve this, let n=2mn = 2^m, so n=2m/2\sqrt{n} = 2^{m/2} and m=log⁡2nm = \log_2 n:

S(2m)=S(2m/2)+1S(2^m) = S(2^{m/2}) + 1

Let $G(m) = S(2^m)$. Then:

G(m)=G(m/2)+1G(m) = G(m/2) + 1

By the Master Theorem (Case 2 with a=1,b=2,k=0a=1, b=2, k=0):

G(m)=Θ(log⁡m)G(m) = \Theta(\log m)

Substitute back m=log⁡2nm = \log_2 n:

S(n)=Θ(log⁡log⁡n)S(n) = \Theta(\log \log n)

Since T(n)=n⋅S(n)T(n) = n \cdot S(n):

T(n)=Θ(nlog⁡log⁡n)T(n) = \Theta(n \log \log n)

Hence, (A) is the correct option.

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 Q42 of the GATE CSE 2024 Set 1 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. 12 of them are 2-mark MCQs like this one, and GATE CSE 2024 Set 1 has 2.

How GATE tests Asymptotic Analysis

More from GATE CSE 2024 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2024 Set 1 · Q42 · MCQ

Consider the following recurrence relation: T(n) = √(n) T(√(n)) + n & for n ≥ 1, 1 & for n = 1. Which one of the following options is CORRECT?

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.