Mathematics I / Computational Complexity
Practice question · Numerical answer

A quadratic algorithm takes 4 seconds on an input of size 1000. Assuming the quadratic model holds, roughly how many seconds does it take on an input of size 3000?

Hints
  1. Quadratic means the time scales with the square of the size.
  2. Tripling the input multiplies the work by 3 squared.
Show the answer

36

Why

Tripling n multiplies quadratic work by 9, so 4 seconds becomes 36. Note that the constant factor never had to be known, that is exactly the information big-O throws away and still predicts correctly.

Read the lesson: Computational Complexity →

Practise Computational Complexity

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

More questions on Computational Complexity