Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-2lccl Total loading time: 0 Render date: 2024-04-28T21:30:52.995Z Has data issue: false hasContentIssue false

5 - Fundamentals of Amortization

Published online by Cambridge University Press:  17 September 2009

Chris Okasaki
Affiliation:
Columbia University, New York
Get access

Summary

Over the past fifteen years, amortization has become a powerful tool in the design and analysis of data structures. Implementations with good amortized bounds are often simpler and faster than implementations with comparable worst-case bounds. In this chapter, we review the basic techniques of amortization and illustrate these ideas with a simple implementation of FIFO queues and several implementations of heaps.

Unfortunately, the simple view of amortization presented in this chapter breaks in the presence of persistence―these data structures may be extremely inefficient when used persistently. In practice, however, many applications do not require persistence, and for those applications, the implementations presented in this chapter are excellent choices. In the next chapter, we will see how to reconcile the notions of amortization and persistence using lazy evaluation.

Techniques of Amortized Analysis

The notion of amortization arises from the following observation. Given a sequence of operations, we may wish to know the running time of the entire sequence, but not care about the running time of any individual operation. For instance, given a sequence of n operations, we may wish to bound the total running time of the sequence by O(n) without insisting that every individual operation run in O(1) time. We might be satisfied if a few operations run in O(log n) or even O(n) time, provided the total cost of the sequence is only O(n).

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 1998

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Fundamentals of Amortization
  • Chris Okasaki, Columbia University, New York
  • Book: Purely Functional Data Structures
  • Online publication: 17 September 2009
  • Chapter DOI: https://doi.org/10.1017/CBO9780511530104.006
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Fundamentals of Amortization
  • Chris Okasaki, Columbia University, New York
  • Book: Purely Functional Data Structures
  • Online publication: 17 September 2009
  • Chapter DOI: https://doi.org/10.1017/CBO9780511530104.006
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Fundamentals of Amortization
  • Chris Okasaki, Columbia University, New York
  • Book: Purely Functional Data Structures
  • Online publication: 17 September 2009
  • Chapter DOI: https://doi.org/10.1017/CBO9780511530104.006
Available formats
×