+1 vote
in Data Structures & Algorithms I by (88.2k points)
What can be the value of m in the division method?

(a) Any prime number

(b) Any even number

(c) 2^p – 1

(d) 2^p

I want to ask this question from Hash Tables in section Hash Tables of Data Structures & Algorithms I

I have been asked this question in unit test.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
Correct option is (a) Any prime number

Easy explanation - A prime number not too close to an exact power of 2 is often a good choice for m since it reduces the number of collisions which are likely to occur.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...