StreakPeaked· Practice

ExamsGATETechnical

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?

  1. T(n) = Θ(n log log n)
  2. T(n) = Θ(n log n)
  3. T(n) = Θ(n² log n)
  4. T(n) = Θ(n² log log n)

Correct answer: T(n) = Θ(n log log n)

Solution

The recurrence relation indicates that the function T(n) grows based on the size of n and its logarithmic factors, specifically due to the repeated halving of n (as seen in T(√n)). This leads to a complexity that is proportional to n multiplied by the logarithm of the logarithm of n, hence T(n) = Θ(n log log n) is the correct characterization.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →