Computer Science

Space Complexity, explained

Space complexity describes how much memory an algorithm needs as input size grows.
Back to Glossary

Part of the Semantic Notion technical glossary.

Short Definition

Space complexity describes how much memory an algorithm needs as input size grows.

Intuition

A fast method can still fail if it needs too much memory.

Technical Definition

Space complexity is the asymptotic memory required by an algorithm, including auxiliary data structures and sometimes input storage depending on convention.

Example

A dynamic programming algorithm may trade extra memory for faster computation.

Common Misunderstandings

Low time complexity does not imply low memory use.
Memory access patterns can matter as much as total memory volume.

Start here

Need the broader concept map?

Return to the glossary index to move from this definition into adjacent AI, ML, mathematics, and computer science terms.