Amortized complexity in layman’s terms?

Amortized complexity is the total expense per operation, evaluated over a sequence of operations. The idea is to guarantee the total expense of the entire sequence, while permitting individual operations to be much more expensive than the amortized cost. Example: The behavior of C++ std::vector<>. When push_back() increases the vector size above its pre-allocated value, … Read more