+1 vote
in Data Structures & Algorithms I by (88.2k points)
Which of the following is the hashing function for separate chaining?

(a) H(x)=(hash(x)+f(i)) mod table size

(b) H(x)=hash(x)+i^2  mod table size

(c) H(x)=x mod table size

(d) H(x)=x mod (table size * 2)

This interesting question is from Hash Tables in chapter Hash Tables of Data Structures & Algorithms I

The question was posed to me in final exam.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
The correct option is (c) H(x)=x mod table size

For explanation: The hashing function for separate chaining is given by H(x)= key mod table size. H(x)=hash(x)+i2  mod table size defines quadratic probing.

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.