Question:medium

In a double hashing scheme, \( h_1(k) = k \mod 11 \) and \( h_2(k) = 1 + (k \mod 7) \) are the auxiliary hash functions. The size \( m \) of the hash table is 11. The hash function for the \( i \)-th probe in the open address table is \( [h_1(k) + i \cdot h_2(k)] \mod m \). The following keys are inserted in the given order: 63, 50, 25, 79, 67, 24. The slot at which key 24 gets stored is:

Show Hint

In double hashing, ensure that the second hash function helps in reducing clustering by selecting a good step size. Always check if the slot is already occupied and probe further using the given formula.
Updated On: Jan 30, 2026
Show Solution

Correct Answer: 10

Solution and Explanation

Each key is first mapped to an initial position using a primary mapping rule. If that position is already occupied, the key advances through the table in fixed jumps determined by a secondary value, wrapping around the table as needed.

For the key 24, the initial position evaluates to \(2\), but this slot is already occupied. The jump size associated with this key is \(4\), so subsequent positions examined are obtained by repeatedly adding this value to the initial position (modulo the table size).

The sequence of candidate slots becomes:

\(2 \rightarrow 6 \rightarrow 10\)

The first available slot encountered in this sequence is \(10\).

Hence, the key 24 is stored in slot \(\boxed{10}\).

Was this answer helpful?
0