First page Back Continue Last page Summary Graphic
Amortized analysis
Remember
- Amortization: worst case performance for a sequence of m operations is O(m log n). Therefore the amortized complexity for 1 operation becomes O(log n)
- Amortization scheme
- Overcharge some operation
- Save the extra cash in a 'bank account'
- Withdrawal from the account to pay expensive operation (when the actual cost is > log n)
- Show that there is always enough in the bank account to pay for the upcoming operation.