Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Suppose we have a hash table with 13 elements, and we want to insert an element with key 14. If we're given hash functions $h_1(k) = k\mod13$ and $h_2(k) = 1+(k\mod11)$, how can we determine which position in the hash table the 14 is to be inserted?

My textbook describes the probe sequence as 2, 6, 10 but I don't know how this is determined. Does the 2 come from $h_1(14) = 14\mod13 = 1$, $h_2(1) = 1+(1\mod11) = 2$? If so, how can I now find the 6, 10?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.