This code (extraced from an LZW compression program of unknown origin) finds an empty slot in a hash table of size 5021, indexed from 0 to 5020:
probe := <random 12-bit hash key>
// probe is initially 0 to 4095
repeat
{
if table[probe] is empty then return(probe);
if probe == 0 then probe := -1 else dec(probe, 5021-probe);
if probe < 0 then inc(probe, 5021);
}
This isn't quite the typical linear or quadratic probing. Why probe like that? Is this a known probing algorithm, and where can I find out more about it?