






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concepts of amortized complexity, focusing on the potential function method and accounting method. The potential function method involves calculating the potential function p(i) for each operation i, while the accounting method guesses the amortized cost and proves that the potential difference p(i) - p(i-1) is non-negative for all i. Examples to illustrate these methods.
Typology: Slides
1 / 11
This page cannot be seen from the preview
Don't miss anything!







WAggregate method.
a = x + ( ( a + b ) * c + d ) + y ; actual cost amortized cost potential
Potential = stack size except at end.
create an empty stack; for (int i = 1; i <= n; i++) // n is number of symbols in statement processNextSymbol();
counter
counter
one unit of amortized cost is used to pay for the change in bit 2 from 0 to 1 the other unit remains as a credit on bit 2 and is used later to pay for the time when bit 2 changes from 1 to 0 the change in bits 0 and 1 from 1 to 0 is paid for by the credits on these bits
bits credits
= 0