Here's a quote from my textbook:
Although reallocating an array is an O(n) operation, it is amortized over n items, so the cost per item is O(1).
I can't find a clear definition for what amortized means in this context.
Here's a quote from my textbook:
Although reallocating an array is an O(n) operation, it is amortized over n items, so the cost per item is O(1).
I can't find a clear definition for what amortized means in this context.