Algorithms

Space complexity

How the memory an algorithm uses grows as the amount of data grows.

Example

Copying a list of 1,000 numbers uses 1,000 more slots: O(n). Adding it up uses 1 variable: O(1).

Test yourself: Space complexity

Space complexity

Which space is NOT usually counted in space complexity?

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.