AmortizedAnalysis

Can be more or less di data structure after ith

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: l counter is not zero. 15 Accounting method (banker's method) Assign different charges to each operation. can be more or less ・Di = data structure after ith operation. than actual cost th operation. ・ci = actual cost of i ・ĉi = amortized cost of ith operation = amount we charge operation i. ・When ĉi > ci, we store credits in data structure Di to pay for future ops; when ĉi < ci, we consume credits in data structure Di. ・Initial data structure D0 starts with zero credits. Key invariant. The total number of credits in the data structure ≥ 0. n n ci ˆ i=1 ci 0 i=1 16 Accounting method (banker's method) Assign different charges to each operation. can be more or less ・Di = data structure after ith operation. than actual cost th operation. ・ci = actual cost of i ・ĉi = amortized cost of ith operation = amount we charge operation i. ・When ĉi > ci, we store credits in data structure Di to pay for future ops; when ĉi < ci, we consume credits in data structure Di....
View Full Document

This document was uploaded on 02/05/2014.

Ask a homework question - tutors are online