Double Hashing

Can you plz happens when 47 and 55 is inserted ( how and why is it inserted in that location of the index
http://tinypic.com/r/5fnn0p/8

http://www.cplusplus.com/forum/general/134132/#msg717608

This is called linear probing. It is a hashing method whereby if an index is already occupied by a value, the function then iterates the list from that point (Sometime having to start from the beginning of the list) until it finds an empty spot and that is where the value is inserted.

The search terminates if the probing comes back the spot where it started which indicates that the list is full. It is usually recommended to have to list at a maximum of 70% full and dynamically grow or shrink the list as needed, that way insertion is still efficient.

Using this knowledge, you can now see why 47 is inserted where it was. Also the number of probes value for 55 should be 4 not 2
Topic archived. No new replies allowed.