IAE Academy

GATE 2024 CS1 Q.42: solution and answer

GATE 2024 · CS1Q.42 · 2 marks · MCQ

Consider the following recurrence relation:

Which one of the following options is CORRECT?

  1. (A)

  2. (B)

  3. (C)

  4. (D)

See the question in the paper

Answer and solution

ANSWER

T(n) = Θ(n log log n) — option (A).

Official answer: ASource: Official answer key, GATE 2024 CS1 (IISc Bengaluru)

  1. Substitute , so , and , so .

  2. The recurrence becomes .

  3. Divide both sides by : . Let ; then .

  4. This is a Master-theorem case with , , : since matches the degree of , .

  5. So . Since and , this gives .

  6. This matches option (A).

KEY IDEA

A recurrence with a argument is solved by the double substitution (turning into a halving of ), then dividing through by the multiplicative factor so the recurrence becomes a plain additive one in , solvable directly or via the Master theorem.

WATCH OUT FOR

Stopping after finding and forgetting to re-substitute into the -side, so students report (option B) instead of correctly reducing to get .

From the GATE 2024 CS1 paper. Every question of this paper · Download the full paper · All 14 Complexity questions, with notes

More Complexity questions