Question

Given a hash table TT with 25 slots that stores 2000 elements, the load factor α\alpha for TT 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 α\alpha of a hash table TT is defined as the ratio of the number of stored elements nn to the total number of available slots mm:

α=nm\alpha = \frac{n}{m}

Given:

  • Number of elements n=2000n = 2000
  • Number of slots m=25m = 25
α=200025=80\alpha = \frac{2000}{25} = 80
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.