# Quadratic probing

**Quadratic probing** is an open addressing scheme in computer programming for resolving hash collisions in hash tables. Quadratic probing operates by taking the original hash index and adding successive values of an arbitrary quadratic polynomial until an open slot is found.

Quadratic probing can be a more efficient algorithm in an open addressing table, since it better avoids the clustering problem that can occur with linear probing, although it is not immune. It also provides good memory caching because it preserves some locality of reference; however, linear probing has greater locality and, thus, better cache performance.^{[dubious – discuss]}^{[citation needed]}

Let *h*(*k*) be a hash function that maps an element *k* to an integer in [0, *m*−1], where *m* is the size of the table. Let the *i*^{th} probe position for a value *k* be given by the function

where *c*_{2} ≠ 0 (If *c*_{2} = 0, then *h*(*k*,*i*) degrades to a linear probe). For a given hash table, the values of *c*_{1} and *c*_{2} remain constant.