Space complexity measures how memory or disk-space requirements grow as an algorithm’s input size increases. If n represents the number of active orders, it describes how required storage grows with n. section 7.2
Use big O notation to describe asymptotic growth. This focuses on how requirements scale as input grows, while disregarding lower-order terms; time complexity describes runtime growth separately. section 7.2
The surrounding complexity model supports practical comparisons:
- Treat input size explicitly: an array’s length or the number of active orders can serve as n. section 7.2
- Compare average and worst-case behavior when evaluating algorithms and data structures; hash-table operations illustrate the difference between typical O(1) and worst-case O(n). section 7.2
Figure 7.1 Illustration of algorithmic complexity in big O notation for constant time 𝑂(1), logarithmic time 𝑂(log𝑛), linear time 𝑂(𝑛), and quadratic time 𝑂(𝑛2)
Use the growth curves to build intuition for asymptotic notation, including constant, logarithmic, linear, and quadratic behavior. section 7.2


