Question: Consider a hash table with linear probing. For the given hash table and hash function of key%7key%7, select the contents of each bucket after the
Consider a hash table with linear probing. For the given hash table and hash function of key\%7key%7, select the contents of each bucket after the following operations.
HashInsert(numsTable, item 23)
HashInsert(numsTable, item 100)
HashInsert(numsTable, item 271)
HashInsert(numsTable, item 31)
Legend of the table entries: for numsTable[0-6]
Occupied
Empty-since-start
Empty-after-removal
| 0 | 63 |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 |
2. A hash table uses the module hash function (k \% table\_sizek%table_size) to map the keys and linear probing to resolve collisions. After inserting six values into an empty hash table, the table is as follows:
| Index | value |
| 0 | |
| 1 | |
| 2 | 42 |
| 3 | 23 |
| 4 | 34 |
| 5 | 52 |
| 6 | 46 |
| 7 | 33 |
| 8 | |
| 9 |
Which one of the following choices gives a possible order in which the keys could have been inserted into the table?
42, 46, 33, 23, 34, 52
46, 34, 42, 23, 52, 33
46, 42, 34, 52, 23, 33
34, 42, 23, 52, 33, 46
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
