Discussion on Hash Tables
Discover more aspects regarding hash tables.
We'll cover the following...
Hash tables and hash codes represent an enormous and active field of research that is just touched upon in this chapter. The online Bibliography
on
A variety of different hash table implementations exist. The one we discussed before in this chapter is known as hashing with chaining (each array entry
contains a chain (List
) of elements). Hashing with chaining dates back to
an internal IBM memorandum authored by H. P. Luhn and dated January
1953. This memorandum also seems to be one of the earliest references
to linked lists.
An alternative to hashing with chaining is used by open addressing schemes, where all data is stored directly in an array. These schemes include the LinearHashTable
structure. This idea was also
proposed, independently, by a group at IBM in the 1950s. Open addressing schemes must deal with the problem of collision resolution: the case
where two values hash to the same array location. Different strategies
exist for collision resolution; these provide different performance guarantees and often require more sophisticated hash functions than the ones
described here.
Yet another category of hash table implementations are the so-called
perfect hashing methods. These are methods in which find(x)
operations
take time in the worst-case. For static data sets, this can be accomplished by finding perfect hash functions for the data; these are functions
that map each piece of data to a unique array location. For data that
changes over time, perfect hashing methods include
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy