Question
Given a hash table with 25 slots that stores 2000 elements, the load factor for is _____.
Official answer and solution
- Official answer
- 80
- From
- Official GATE 2015 answer key
Solution
Apply the definition of hash table load factor.
The load factor of a hash table is defined as the ratio of the number of stored elements to the total number of available slots :
Given:
- Number of elements
- Number of slots
Final answer
80
Common trap
Inverting the ratio (25 / 2000 = 0.0125) instead of computing elements per slot.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 3
- Question
- 27 of 65, printed as CS Q.17
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.