~/ 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/7fcd80fc-f820-47ce-85a1-c27b9665f9a2/flashcard utf-8 LF