Amortized analysis allows analyzing the average performance of a sequence of operations on a data structure, even if some operations are expensive. There are three main methods for amortized analysis: aggregate analysis, accounting method, and potential method.
The accounting method assigns differing amortized costs to operations. When the amortized cost is higher than actual cost, the difference is stored as credit. Later operations may use accumulated credits when their amortized cost is lower than actual cost.
The potential method associates potential energy with the data structure as a whole. The amortized cost of an operation is the actual cost plus the change in potential. If potential never decreases, the total amortized cost bounds the total