Explain the concept of amortized time complexity.

Explain the concept of amortized time complexity.

Approach: Describe the average time per operation over a sequence of operations.

A way to analyze the average performance of an operation in a sequence, even if a single operation in that sequence is expensive. For example, inserting into a dynamic array is O(1) amortized.

Follow-up: How does resizing a dynamic array affect this?

Key concepts: dynamic array, potential method, accounting method.