*** Welcome to piglix ***

Linear hashing


Linear hashing is a dynamic hash table algorithm invented by Witold Litwin (1980), and later popularized by Paul Larson. Linear hashing allows for the expansion of the hash table one slot at a time. The frequent single slot expansion can very effectively control the length of the collision chain. The cost of hash table expansion is spread out across each hash table insertion operation, as opposed to being incurred all at once. Linear hashing is therefore well suited for interactive applications.

First the initial hash table is set up with some arbitrary initial number of buckets. The following values need to be kept track of:

Bucket collisions can be handled in a variety of ways but it is typical to have space for two items in each bucket and to add more buckets whenever a bucket overflows. Addresses are calculated in the following way:

To add a bucket:

The effect of all of this is that the table is split into three sections; the section before , the section from to , and the section after . The first and last sections are stored using and the middle section is stored using . Each time reaches the table has doubled in size.


...
Wikipedia

...