Skip to content

Glossary: Coding Interviews in C++

Trading space for time

Also written: trade space for time

Using extra memory, such as a hash set of what you have seen, to make a solution faster. It turns O(n²) into O(n).

Where the book teaches it

Related terms

BottleneckHash map / hash set