Skip to content
Official PYQ · 2017

GATE CS 2017 Set 1 Q04 — Asymptotic Worst Case Time and Space Complexity

Explain with AI

Consider the following functions from positive integers to real numbers:

1010, n\sqrt{n}, nn, log⁡2n\log_{2}n, 100n\frac{100}{n}.
The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:

Choose one option
View worked solution

Answer: B

To arrange the given functions in increasing order of asymptotic complexity, we analyze their growth rates as n→∞n \to \infty:

  1. 100n\frac{100}{n}: As nn grows very large, this function approaches 00. Thus, it has the slowest growth rate (it actually decreases), which is asymptotically smaller than any constant: 100n=o(1)\frac{100}{n} = o(1)
  2. 1010: This is a constant function. Its value remains 1010 regardless of nn: 10=Θ(1)10 = \Theta(1)
  3. log⁡2n\log_{2}n: This is a logarithmic function. It grows to infinity, but extremely slowly compared to any positive polynomial power of nn: log⁡2n=o(nc)for any c>0\log_{2}n = o(n^c) \quad \text{for any } c > 0
  4. n\sqrt{n}: This is a fractional power function (n0.5n^{0.5}). It grows faster than logarithmic functions but slower than linear functions: n=o(n)\sqrt{n} = o(n)
  5. nn: This is a linear function, which grows the fastest among all the given functions.

Comparing these growth rates, we get the following chain of asymptotic dominance:

100n<10<log⁡2n<n<n\frac{100}{n} < 10 < \log_{2}n < \sqrt{n} < n

Therefore, the correct increasing order is 100n\frac{100}{n}, 1010, log⁡2n\log_{2}n, n\sqrt{n}, nn, which corresponds to option B.

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

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