AlgoFrames

Predict a double-hashing slot

Standard · Predict the result · about 4 min

A table of 7 slots uses double hashing: h(k) = k mod 7 and step h2(k) = 1 + k mod 6. The code inserts 3, 10 and 17. What does it print?

Constraints

  • Answer with a number.

Learn the idea first: Open addressing: linear, quadratic probing, double hashing, a visual lesson.

More Open addressing: linear, quadratic probing, double hashing problems