CPSC 320 Lecture 4: CPSC_320__Amortized_Analysis_II

8 views4 pages
31 Oct 2022
School
Course
Professor

Document Summary

Beginning of class announcements: unfortunately assignment 4 was not returned today, but it will hopefully be returned by next class. At the conclusion of the previous class we considered three possible potential functions for the analysis of the binary counter. These included: the number of 1s in the counter, the number of bits in the counter, the number of consecutive ones on the right of the counter. We want a potential function to satisfy the following properties: if costreal(opi) is high, then should decrease, if costrealopi is low, then should increase but not by much. Next we consider the third choice for a potential function. When the binary counter is at 0111110, the potential function is 0 since the right-most digit is 0. However, when we increment this counter, the binary counter becomes 0111111. Now the po- tential function is about log2n, the number of bits in the counter, although only one bit was changed.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions