~/ learn/ comp-372/ cards/ Amortized analysis
1 of 5

Potential-method amortized cost (the defining equation)

Potential-method amortized cost (the defining equation)

Answer

amortized_cost = actual_cost + Phi(D_i) - Phi(D_{i-1}) # Stack with Phi(D) = number of items: # PUSH: 1 + (+1) = 2 # POP: 1 + (-1) = 0 # MULTIPOP: k + (-k) = 0

The amortized cost is actual cost plus the change in potential. Telescoping the sum gives total actual cost + Φ(Dₙ) − Φ(D₀); if Φ never drops below Φ(D₀), the amortized total bounds the real total.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/20484ca9-b406-4073-9a22-d2f21b6b7dd4/flashcard utf-8 LF