Algorithms and Data Structures · Junior · Question 73 of 75

An algorithm is O(n²). Roughly how much longer does it take when the input grows from 1,000 to 10,000 items?

Explanation

The input grew 10 times, so n² grew 10² = 100 times. For O(n) it would be about 10 times, for O(log n) just a few extra steps.

Further reading

Problem with a question

Algorithms and Data Structures · Junior · question 73

Test yourself

Take the Algorithms and Data Structures · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz