Question
1.Consider hashing with a table size of 100 and a hash function of key%tablesize. Insert 25 keys. Do you expect to see any collisions? Why
1.Consider hashing with a table size of 100 and a hash function of key%tablesize. Insert 25 keys. Do you expect to see any collisions? Why or why not?
Yes, because random values likely will land on same locations. |
No becase there are four times as many slots as needed. |
2. Secondary clustering means that elements that hash to the same position will probe to the same alternate cells. Simple hashing uses key%tablesize as the hash function.
Which of the following sequence of insertions would demonstrate secondary clustering of quadratic probing if the tablesize is 100?
1,3,5,7,9 |
Secondary clustering is unlikely with quadratic probing. |
1,2,3,4,5,6 |
259,359,459,559 |
0,1,4,9,16,25,36,49 |
3.Using double hashing (as the Collision Resolution technique), consider inserting multiple copies of the same value Is there clustering?
The table is large enough there is little chance for collision. |
Because neighbors are not used for overflow, clustering does not occur. |
Each key has a unique step function. |
There is clustering. It is impossible to prevent. |
4. Consider the following collision resolution scheme: You use linear probing, but always increment by 3 (rather than 1) in the event of a collision.
Which is true of this method?
secondary clustering |
non-clustering |
primary clustering |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started