Computer Science I / Complexity and Performance Trade-offs
Practice question · Put in order

Order these growth classes from the slowest-growing to the fastest-growing as n becomes large.

Hints
  1. Judge by behaviour for LARGE n, not by which looks more complicated to write.
  2. Linearithmic sits between linear and quadratic, because the extra factor is a logarithm rather than another n.
Show the answer
  1. Constant
  2. Logarithmic
  3. Linear
  4. Linearithmic
  5. Quadratic
  6. Exponential
Why

The order is constant, logarithmic, linear, linearithmic, quadratic, exponential. Linearithmic is only a logarithm worse than linear, which is why a good sort stays practical on huge inputs while a quadratic sort does not, and why exponential algorithms become impossible at input sizes the others handle easily.

Read the lesson: Complexity and Performance Trade-offs →

Practise Complexity and Performance Trade-offs

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Complexity and Performance Trade-offs