What does the load factor of a hash table represent?

Options

  • A. Number of elements divided by table size
  • B. Table size divided by number of elements
  • C. Number of deleted elements only
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. Number of elements divided by table size

Detailed Explanation

The load factor of a hash table represents how full the table is. It is commonly calculated as α = n/m, where n is the number of stored elements and m is the number of available table slots. A higher load factor generally means more collisions and potentially slower operations, especially with open addressing. Hash-table implementations often perform rehashing or resize the table when the load factor becomes too high.