home | articles | links | fun | about
Up to: Quick math and science observations

potential method:

it costs us something to "lift" the data structure to some potential. Then, after that, we can perform operations which take away from this potential. Some ops release energy, others cost it. From this, can calculate the amortized cost of individual operations.

If the initial potential is O(n), then the total cost of all the operations in O(n), because this initial amount of energy can pay for any sequence of operations. See what i mean?

accounting method:

start with zero energy, add credit for some ops, subtract it for others.

difference: backwards or forward. potential method has credit based on data structure, so differences in data structure determines cost of operation.

accounting: has credit per operation... prove that you always have enough to perform any operation