Amortized Analysis - Potential Method I read about Potential Method when I was trying to understand some calculations.

I just can't understand how do you perform the calculation it self. How can you even define $O(n)-O(n)$ as it is used in the Wikipedia page? I just don't understand where is the calculation done.

Is there any good and simple example of this kind of analysis?

Shay
http://theory.cs.uiuc.edu/~jeffe/teaching/algorithms/notes/15-amortize.pdf specifically for amortization, and http://theory.cs.uiuc.edu/~jeffe/teaching/algorithms/ generally