*** Welcome to piglix ***

Double hashing


Double hashing is a computer programming technique used in hash tables to resolve hash collisions, in cases when two different values to be searched for produce the same hash key. It is a popular collision-resolution technique in open-addressed hash tables. Double hashing is implemented in many popular libraries.

Like linear probing, it uses one hash value as a starting point and then repeatedly steps forward an interval until the desired value is located, an empty location is reached, or the entire table has been searched; but this interval is decided using a second, independent hash function (hence the name double hashing). Unlike linear probing and quadratic probing, the interval depends on the data, so that even values mapping to the same location have different bucket sequences; this minimizes repeated collisions and the effects of clustering.

Given two randomly, uniformly, and independently selected hash functions and , the ith location in the bucket sequence for value k in a hash table is: Generally, and are selected from a set of universal hash functions.


...
Wikipedia

...