Practice question · Estimate
An simulation takes 2 seconds for particles. Predict its runtime for , in seconds.
Estimate on a scale from 0 s (0) to 100 s (100).
Hints
- Quadratic work scales with the square of the size ratio.
- 5× the particles → the time.
Show the answer
50 (answers within ±5 count)
Why
s. Extrapolating by growth class is a superpower: before buying hardware, you know 50,000 particles would take ~83 minutes, and that an algorithm is worth finding.
Practise Complexity and efficiency basics
The app has 8 more questions on this lesson, and keeps your place in the course. Physics I is free to start.
More questions on Complexity and efficiency basics
- O(n²) simplifies to O(n) in Big-O notation, since constant factors are dropped.
- An O(n²) algorithm can beat an O(nlog n) one on real data. How is that consistent with the complexity classes?
- Two nested loops each running n times give O(n²). Why does the analysis not simply add the two loops?
- Match each everyday task to the growth rate of its work as n grows.