Aug-03-2019, 01:04 PM
I'm assuming you know what a hash table is. Open addressing keeps everything on the hash table. Quadratic probing is a way to deal with hash collisions. Note that you are using hash % table size, that reduces the range of possible hashes drastically, so you will often have two different hashes trying to store in the same spot on the table. That's a hash collision. Quadratic probing means you keep trying new hashes (probing) by adding n**2 to the hash (quadratic). So if hash is taken, you try hash + 1, hash + 4, hash + 9, and so on until you find an open slot.
This page has some discussion of the issues and how to implement them.
This page has some discussion of the issues and how to implement them.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures