Space complexity(memory cost)

How much memory an algorithm holds at its peak as the input grows. A running total is constant, a copy of the input is linear, a grid is quadratic. Peak matters, not the total ever allocated.

Back to the glossary