Given the following hash table, use hash function hashFunction and handle collisions using Quadratic Probing with probe function p(K, i) = i*i.
In which slot should the record with key value probeCommon.currentKey be inserted?
First use the hash function to computer the home slot.
If there is a collision, then the i
'th place
to look is i*i
steps from the home slot.
Remember that offsets are always with respect to the home slot, not from the last slot probed to.
If we reach the end of the array while stepping, then cycle around to the beginning.