Skip to content
Official PYQ · 2011

GATE CS 2011 Q37 — Asymptotic Worst Case Time and Space Complexity

Explain with AI

Which of the given options provides the increasing order of asymptotic complexity of functions f1,f2,f3f_1, f_2, f_3 and f4f_4?

  • f1(n)=2nf_1(n) = 2^n
  • f2(n)=n3/2f_2(n) = n^{3/2}
  • f3(n)=nlog⁡2nf_3(n) = n \log_2 n
  • f4(n)=nlog⁡2nf_4(n) = n^{\log_2 n}
Choose one option
View worked solution

Answer: A

To find the increasing order of asymptotic complexity, we compare the growth rates of the functions as n→∞n \to \infty:

  1. Comparing f3(n)f_3(n) and f2(n)f_2(n):
    f3(n)=nlog⁡2nf_3(n) = n \log_2 n and f2(n)=n1.5=n⋅n0.5f_2(n) = n^{1.5} = n \cdot n^{0.5}. Since log⁡2n<n0.5\log_2 n < n^{0.5} for large nn, we have f3(n)<f2(n)f_3(n) < f_2(n).
  2. Comparing f2(n)f_2(n) and f4(n)f_4(n):
    Taking the base-2 logarithm of both functions:
    log⁡2(f2(n))=1.5log⁡2n\log_2(f_2(n)) = 1.5 \log_2 n
    log⁡2(f4(n))=(log⁡2n)2\log_2(f_4(n)) = (\log_2 n)^2
    Since 1.5log⁡2n<(log⁡2n)21.5 \log_2 n < (\log_2 n)^2 for large nn, we have f2(n)<f4(n)f_2(n) < f_4(n).
  3. Comparing f4(n)f_4(n) and f1(n)f_1(n):
    Expressing f4(n)f_4(n) with base 2 gives f4(n)=2(log⁡2n)2f_4(n) = 2^{(\log_2 n)^2}. Since (log⁡2n)2<n(\log_2 n)^2 < n for large nn, we have f4(n)<f1(n)f_4(n) < f_1(n).

Combining these relations gives the increasing order of complexity: f3<f2<f4<f1f_3 < f_2 < f_4 < f_1

Hence, the correct option is A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Asymptotic Worst Case Time and Space Complexity questions