A method to collect Amortized Time.
Method
- Sum the Worst Case Costs for each operation
- Examine if any operations depend on each other and simplify
- Divide total cost by # of operations
Example
Data structure where the -th operation costs if it is an exact power of 2, otherwise. Find aggregate cost per operation. Soln:
- Then, aggregate cost is