Home »
MCQs »
Data Structure and Algorithms (DSA) MCQs
Which of the following asymptotic notations is the worst among all?
17. Which of the following asymptotic notations is the worst among all?
- O(n)
- O(1)
- O(n^3)
- O(2n)
Answer
The correct answer is: C) O(n^3)
Explanation
- O(n3) being cubic is the worst one.
- O(n) is dependent on n.
- O(1) is constant.
- O(2n) is dependent on n but O(n) is better.