Last Updated : 19 Nov, 2018

Consider a hashing table of 100 slots if the there are 30 keys to be hashed in the hash table using the hash function h(k) = k mod 10. What will be the load factor and if there are collisions, then which technique is used to resolve collisions?
(A) 0.3 and open chaining
(B) 0.3 and open addressing
(C) 0.7 and chaining
(D) None of these


Answer: (B)

Explanation: Load factor (α) = Keys / slots
Load factor (α) = 30 / 100 = 0.3
If α is greater than 1 then it will be resolved by chaining and if it is less than equal to 1 then it will be resolved by Open Addressing methods. Open addressing method doesn\’t use any extra space. It resolved using the table\’s space only. Chaining required extra space and it is implemented by using linked list data structure.
So, option (B) is correct.

Quiz of this Question


Share your thoughts in the comments