Skip to interview prep
Apexed

2. Order these growth rates: n log n, 2ⁿ, log n, n², n, 1, n!.

EasyAlgorithm analysis

Technical

Type or dictate your answer. Your draft is saved on this device.

Show model answer

From slowest to fastest growth: 1 < log n < n < n log n < n² < 2ⁿ < n!. Run the program to see how quickly they diverge even for small n.

Example program

Order these growth rates: n log n, 2ⁿ, log n, n², n, 1, n!. — Data structures & algorithms interview question — Apexed