Lably
Skip to content

Quadratic probing

Address collision resolution scheme

  • 4 min read
  • 3 chapters

Related on Lably

Through Computer programming, Quadratic function and Data structure

An example sequence using quadratic probing is:

H+12,H+22,H+32,H+42,...,H+k2

Quadratic probing is often recommended as an alternative to linear probing because it incurs less clustering. Quadratic probing exhibits better locality of reference than many other hash table such as chaining; however, for queries, quadratic probing does not have as good locality as linear probing, causing the latter to be faster in some settings.

History

Quadratic probing was first introduced by Ward Douglas Maurer in 1968. Several subsequent variations of the data structure were proposed in the 1970s in order to guarantee that the probe sequence hits every slot without cycling prematurely. Quadratic probing is widely believed to avoid the clustering effects that make linear probing slow at high load factors. It serves as the basis for many widely used high-performance hash-tables, including Google's open-source Abseil hash table.

It is conjectured that quadratic probing, when filled to 1−ϵ full, supports insertions in expected time O(ϵ−1). Proving this, or even proving any non-trivial time bound for quadratic probing remains open. The closest result, due to Kuszmaul and Xi, shows that, at load factors of less than ≈0.089, insertions take O(1) expected time.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication