Skip to content
GATEiit

GATE CSE 2024 Session 1 Q42: Solve T(n) = √n T(√n) + n

Question

Consider the following recurrence relation:

T(n)={n T(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?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: A (official GATE 2024 final answer key)

Concept used: Divide by nn to get a recurrence in S(n)=T(n)/nS(n) = T(n)/n, then substitute n=2mn = 2^m.

First step: T(n)/n=T(n)/n+1T(n)/n = T(\sqrt{n})/\sqrt{n} + 1, so S(n)=S(n)+1S(n) = S(\sqrt{n}) + 1, which unrolls log⁡log⁡n\log\log n times.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2024 Session 1 CS question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key