vimwiki/tech/quadratic_probing.wiki

17 lines
504 B
Plaintext

= Quadratic Probing =
Quadratic probing is a scheme for resolving hash collisions in [[hash_table]]s.
It operates by taking the original hash index and adding sucessive values of an
arbitrary quadratic polymoial until an open solt is found.
== Example ==
For some `h(k)` that is a hash function, mapping to the keyspace [0, m-1],
where m is the size of a hash table, let the _i_th probe position for some _k_
be,
{{{
h(k,i) = h(k) + c1i + c2i^2 mod m
}}}
Where c2 != 0 and c1 and c2 are constants.