A Hash function $f$ is defined as $f(key) = key \pmod 7$. With linear probing, while inserting the keys $25, 34, 41, 56, 19, 72$ into a table indexed from $0$, in which location the key $72$ will be stored (count table Index $0$ as $0^{th}$ location)?
2
This solution explains the process of inserting keys into a hash table using a specific hash function and linear probing for collision resolution. We will trace the insertion of the given keys to determine the final storage location for the key 72.
The hash function is defined as $f(key) = key \pmod 7$. This means the hash table will have indices ranging from 0 to 6. Linear probing is used to handle collisions, where we sequentially search for the next available slot.
We insert the keys in the given order: 25, 34, 41, 56, 19, 72.
Now, we insert the key 72 into the table.
After performing the hash calculations and applying linear probing for collisions, the key 72 is stored at table index 2.