KyoMel / Yogyakarta, Indonesia

Term 032032 / 344

Space Complexity

Month
August 2025
Day
2
Source
2025/august-term.md

Definition:

Space complexity is the amount of memory an algorithm needs to run as a function of the size of its input.

Example:

If an algorithm uses a fixed amount of memory regardless of input size, it has O(1) space complexity. If extra space grows with input, for example, storing an array of size n, it has O(n) space complexity.

Summary: Space complexity measures an algorithm’s memory usage as input size increases.

Keep reading