Skip to main content Accessibility help
×
Hostname: page-component-7479d7b7d-wxhwt Total loading time: 0 Render date: 2024-07-11T19:16:26.354Z Has data issue: false hasContentIssue false

16 - Hashing and Sets

from PART TWO - DATA STRUCTURES

Published online by Cambridge University Press:  05 June 2012

Richard Wiener
Affiliation:
University of Colorado, Colorado Springs
Lewis J. Pinson
Affiliation:
University of Colorado, Colorado Springs
Get access

Summary

Hash tables are containers that represent a collection of objects inserted at computed index locations. Each object inserted in the hash table is associated with a hash index. The process of hashing involves the computation of an integer index (the hash index) for a given object (such as a string). If designed properly, the hash computation (1) should be fast, and (2) when done repeatedly for a set of keys to be inserted in a hash table should produce hash indices uniformly distributed across the range of index values for the hash table. The term “hashing” is derived from the observation that there should be little if any obvious association between the object being inserted and its hash index. Two closely related objects such as the strings “time” and “lime” should generally produce unrelated hash indices. Thus hashing involves distributing objects into what appears to be random (but reproducible) locations in the table.

When two distinct objects produce the same hash index, we refer to this as a collision. Clearly the two objects cannot be placed at the same index location in the table. A collision resolution algorithm must be designed to place the second object at a location distinct from the first when their hash indices are identical.

The two fundamental problems associated with the construction of hash tables are:

  1. the design of an efficient hash function that distributes the index values of inserted objects uniformly across the table

  2. […]

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

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.

  • Hashing and Sets
  • Richard Wiener, University of Colorado, Colorado Springs, Lewis J. Pinson, University of Colorado, Colorado Springs
  • Book: Fundamentals of OOP and Data Structures in Java
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511807176.017
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.

  • Hashing and Sets
  • Richard Wiener, University of Colorado, Colorado Springs, Lewis J. Pinson, University of Colorado, Colorado Springs
  • Book: Fundamentals of OOP and Data Structures in Java
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511807176.017
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.

  • Hashing and Sets
  • Richard Wiener, University of Colorado, Colorado Springs, Lewis J. Pinson, University of Colorado, Colorado Springs
  • Book: Fundamentals of OOP and Data Structures in Java
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511807176.017
Available formats
×