Classic Example

Incrementing an n-bit binary number.

How many bit flips in the worst case? Best case?


next up previous
Next: Increment Code Up: AMORTIZED ANALYSIS Previous: Idea of Amortized Analysis