Hello everyone, I am looking for a systematic approach to hash random numbers (0 to 200) into an array of 70 elements, evenly distributed if possible. So far I have tried key % 70 but this expression does not use up all 70 elements.
chained hashing of integers C++
Page 1 of 12 Replies - 370 Views - Last Post: 17 November 2012 - 01:29 PM
Replies To: chained hashing of integers C++
#2
Re: chained hashing of integers C++
Posted 17 November 2012 - 12:24 PM
Quote
So far I have tried key % 70 but this expression does not use up all 70 elements.
This hash function should undoubtably fill up a 70 element array if your hashing 0 - 200. Can you post what you have tried so far?
#3
Re: chained hashing of integers C++
Posted 17 November 2012 - 01:29 PM
If it is not filling up then it is only because you are probably not adding enough entries to need every position.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|