1.

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^2mod 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 IThe question was posed to me in final exam.

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)+i2mod table size DEFINES quadratic PROBING.



Discussion

No Comment Found

Related InterviewSolutions