Abstract
In chapter 6 we considered several representations for sets whose elements are integers of arbitrary size. However, all those representations are rather inefficient: at least one of the operations (membership test, adding/deleting an element) runs in time proportional to the number of elements in the set. This is unacceptable in almost all practical applications.
It is possible to find a set representation where all three operations mentioned run in time C log n (in the worst case) for sets with n elements. One such representation is considered in the next chapter. In this chapter, we consider another set representation that may require n operations in the worst case but is very efficient in a “typical”case. The method is called hashing.
We consider two versions of this technique. Open addressing (section 13.1) is somehow simpler (and more efficient in terms of space), especially if we do not need deletion. Then we consider (section 13.2) hashing with lists; this version of hashing is more flexible and easier to analyze.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2010 Springer Science+Business Media, LLC
About this chapter
Cite this chapter
Shen, A. (2010). Set representation. Hashing. In: Algorithms and Programming. Springer Undergraduate Texts in Mathematics and Technology. Springer, New York, NY. https://doi.org/10.1007/978-1-4419-1748-5_13
Download citation
DOI: https://doi.org/10.1007/978-1-4419-1748-5_13
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4419-1747-8
Online ISBN: 978-1-4419-1748-5
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)