Quadratic probing

Published

2023-08-05

Quadratic probing is intended to avoid primary clustering. We probe one step at a time, but our stride varies as the square of the step. Stride values follow the sequence 1, 4, 9, 16, 25, 36, … etc. In this way, we avoid primary clustering.

Resources:

QuadraticProbing.pdf

Comprehension check:

  1. The third step in a quadratic probe sequence will have stride of ___________.

  2. True or false? The nth index in a quadratic probe sequence is given by

    \Bigg( i + \sum\limits_{j=1}^n j^2 \Bigg) \mod t

    where i is the starting index, j is the step, and t is the size of the table.

  3. True or false? Quadratic probing avoids secondary clustering but is prone to tertiary clustering.

  4. Just as with linear probing, when using quadratic probing, if we delete or remove an item from our hash table, we must mark it as “deleted” or “removed”, otherwise we may break the __________________.

Answers: ǝɔuǝnbǝs ǝqoɹd / ǝslɐɟ / ǝnɹʇ / ǝuᴉu

Original author: Clayton Cafiero < [given name] DOT [surname] AT uvm DOT edu >

No generative AI was used in producing this material. This was written the old-fashioned way.

All materials copyright © 2020–2023, The University of Vermont. All rights reserved.