+1 vote
in Data Structures & Algorithms I by (88.2k points)
Using division method, in a given hash table of size 157, the key of value 172 be placed at position ____

(a) 19

(b) 72

(c) 15

(d) 17

I would like to ask this question from Hash Tables topic in section Hash Tables of Data Structures & Algorithms I

This question was addressed to me during an interview for a job.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct option is (c) 15

Easy explanation - The key 172 can be placed at position 15 by using the formula

  H(k) = k mod m

  H(k) = 172 mod 157

  H(k) = 15.

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

...