Which of the following is the hashing function for separate chaining?

Category: QuestionsWhich of the following is the hashing function for separate chaining?
Editor">Editor Staff asked 1 month ago

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 Answers
Editor">Editor Staff answered 1 month ago

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.