-
HELP:Hasing Table
Can anyone tell me more about this...I read the lecture note...but totally no idea what's going on to this.....Hasing table and the closed hashing.....
this is one of the question::::
<code>
5351,5635,5389,5894,5012,5555,5234,5281
(a) using the hash function H(key) = (key -5000)%9, insert these values to simulate the behaviour of a closed hash table. Draw a diagram of the hash table after all values have been inserted in the given order(use liner probing to reslove collisions)
(b) determine the average number of probes to find a value that is in the table from (a)
(c)determine the average number of probes to establish that a value is not in the table from part(a)
(d)Calculate the load factor of the table.
(e)Explain how 5821 maybe delete from the table
</code>
I got no idea about this question..can anyone help..thank very much
-
This sounds like I am doing your homework... Write the program to calculate the hash of the values, then see what the results are.
Code sample:
Code:
int x;
std::cin >> x;
int hash = (x-5000)%9;
std::cout << "hash(" << x << ")=" << hash << std::endl;
That should help you get started. Enter each value and see what the hash is... I leave the rest of this excersize to the reader :)
-
hehe....thx a lot man.....