Key components of quadratic probing
Now that we know quadratic probing, let us look at the structure of a hash table implemented using it. The hash table is just an encapsulation around an array that stores key-value pairs. Different pieces have to be put together to create a hash table. Let us look at all the components and functions needed to implement a hash table using quadratic probing.
Record
Like linear probing, in a quadratic probing implementation of a hash table, each index in the internal array stores only one record, and collisions are handled by finding the next available free slot using quadratic probing. For this reason, at each index in the array, we store the key-value mapping and additional metadata to identify the type of slot(empty, deleted, or occupied).
Liking the course? Check our discounted plans to continue learning.