Maximizing Efficiency through Amortized Cost Analysis