0
$\begingroup$

I want to use these two functions in two hash-tables with open-addressing. Is there any problems with these functions? If yes, why they are not appropriate?

H(k,i) = (k mod m + 3i mod m) mod m

H(k,i) = (k^2 + 2k + i(k mod m)) mod m
$\endgroup$
  • $\begingroup$ Something is missing in your second equation. Please proof-read your question and edit it to correct issues. $\endgroup$ – D.W. May 31 '17 at 1:29
  • $\begingroup$ Did you test them? $\endgroup$ – Pseudonym May 31 '17 at 2:45
  • $\begingroup$ @Pseudonym No. I haven't implemented the Hash. $\endgroup$ – Ju Bc May 31 '17 at 2:48
  • $\begingroup$ You should test it on some data set which is representative of the expected key distribution. $\endgroup$ – Pseudonym May 31 '17 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.