OBHTs: double hashing (1)
Better still, let different keys have different step lengths. (But each key always has the same step length.)
Double hashing: To search/insert/delete key k, compute s from k, using a second hash function s = step(k).
In the following illustration, keys are names of chemical elements. Assume:
m = 23 hash(e) = (initial letter of e – ‘A’) modulo m step(e) = 1, if e has a single letter, otherwise 2 + (second letter of e – ‘a’) modulo 21