A hash table has 7 slots and resolves collisions by chaining, with \(h(k) = k \bmod 7\). Each new key is appended at the end of its chain. The keys\[50,\ 23,\ 31,\ 64,\ 12,\ 45,\ 38,\ 20,\ 57\]are inserted in this order. A search compares the key with the keys of its chain from the front. If each stored key is equally likely to be searched for, the average number of key comparisons in a successful search is (round to 2 decimals).
Curated · Hash Tables
Solve it on GATE DA practice →More Basic Data Structures problems