Skip to main contentSkip to solution

Arrange the following algorithms in increasing order of their complexities.

A. Linear time algorithms

B. Quadratic time algorithms

C. Constant time algorithms

D. Cubic time algorithms

Solution

✅ Correct Option: 4

Running time grows faster as the power of nn increases, so the order is O(1)<O(n)<O(n2)<O(n3)O(1) < O(n) < O(n^2) < O(n^3).

C. Constant time algorithms: O(1)O(1), time does not depend on input size

A. Linear time algorithms: O(n)O(n)

B. Quadratic time algorithms: O(n2)O(n^2)

D. Cubic time algorithms: O(n3)O(n^3)

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question