The GATE Grind

GATE 2021 CS (CS2) – Question 49

Algorithms · Asymptotic Analysis and Time/Space Complexity · 2 marks · Multiple choice

For constants a≥1,b>1, $T(n)=aT(n/b)+f(n)$. Which general claim is correct, under the usual positive constant base-case assumptions?

  1. $f(n)=n\log_2n\Rightarrow T(n)=\Theta(n\log_2n)$
  2. $f(n)=n/\log_2n\Rightarrow T(n)=\Theta(\log_2n)$
  3. $f(n)=O(n^{\log_ba-\epsilon})$ for some ε>0 implies $T(n)=\Theta(n^{\log_ba})$
  4. $f(n)=\Omega(n^{\log_ba})\Rightarrow T(n)=\Theta(n^{\log_ba})$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) $f(n)=O(n^{\log_ba-\epsilon})$ for some ε>0 implies $T(n)=\Theta(n^{\log_ba})$

Explanation

C is the first case of the Master theorem: a polynomially smaller nonrecursive cost leaves the recursion-tree leaf term dominant. A depends on a,b and can acquire extra factors. B cannot hold generally even because its stated f is already larger than logarithmic. D omits both the boundary-case logarithm and the possibility of a much larger f. Thus C.

More Asymptotic Analysis and Time/Space Complexity questions

All Asymptotic Analysis and Time/Space Complexity questions →