+1 vote
in Data Structures & Algorithms I by (88.2k points)
What is the hash function used in multiplication method?

(a) h(k) = floor( m(kA mod 1))

(b) h(k) = ceil( m(kA mod 1))

(c) h(k) = floor(kA mod m)

(d) h(k) = ceil( kA mod m)

Origin of the question is Hash Tables topic in portion Hash Tables of Data Structures & Algorithms I

I got this question in an internship interview.

1 Answer

+1 vote
by (737k points)
selected by
 
Best answer
Right choice is (a) h(k) = floor( m(kA mod 1))

Explanation: The hash function can be computed by multiplying m with the fractional part of kA (kA mod 1) and then computing the floor value of the result.

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

...