×

Multiple-Choice Questions

Which of the following asymptotic notations is the best among all?

18. Which of the following asymptotic notations is the best among all?

  1. O(n)
  2. O(1)
  3. O(n^3)
  4. O(2n)

Answer

The correct answer is: B) O(1)

Explanation

  • O(n3) being cubic is the worst one.  
  • O(n) is dependent on n.
  • O(1) is constant and is the best one.
  • O(2n) is dependent on n but O(n) is better.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.