此代码(从未知来源的 LZW 压缩程序中提取)在大小为 5021 的哈希表中找到一个空槽,索引从 0 到 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);
}
这不是典型的线性或二次探测。为什么要这样探?这是一种已知的探测算法吗?我在哪里可以找到更多关于它的信息?