In a hash table of size 10, where is element 7 placed?

Category: QuestionsIn a hash table of size 10, where is element 7 placed?
Editor">Editor Staff asked 1 month ago

In a hash table of size 10, where is element 7 placed?
 
(a) 6
 
(b) 7
 
(c) 17
 
(d) 16
 
I’d like to ask this question from Hash Tables topic in division Hash Tables of Data Structures & Algorithms I
 
The question was posed to me in exam.

1 Answers
Editor">Editor Staff answered 1 month ago

The correct option is (b) 7
 
Best explanation: The hash location is defined as hash(f)= key mod table_size.
 
7 mod 10 gives 7. It is placed in 7^th position.