GATE 2017 CS (CS1) – Question 14
Consider the following functions from positive integers to real numbers: $10, \sqrt{n}, n, \log_2 n, \frac{100}{n}$.
The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) $\frac{100}{n}, 10, \log_2 n, \sqrt{n}, n$
Explanation
The function $\frac{100}{n}$ tends to 0, so it is the smallest. The constant 10 comes next. Then $\log_2 n$ grows without bound but more slowly than any power of $n$, so it is followed by $\sqrt{n}$ and then $n$.
More Asymptotic Analysis and Time/Space Complexity questions
- GATE 2014 CS (CS1) Q48
- GATE 2014 CS (CS1) Q52
- GATE 2014 CS (CS3) Q21
- GATE 2016 CS (CS2) Q49
- GATE 2017 CS (CS2) Q13
- GATE 2017 CS (CS2) Q40
All Asymptotic Analysis and Time/Space Complexity questions →