Skip to main contentSkip to solution

In Hashing, if every item of the list maps to a unique index in the hash table, the hash function is called as _______________ .

Solution

✅ Correct Option: 2

A perfect hash function maps every key in the list to a distinct index, so no two items share a slot and no collisions occur. Lookups then take constant time with no collision handling.


Option 1: a collision is the opposite case, where two different keys map to the same index.

Option 3: the hash table is the data structure that stores the items, not the function that maps them.

Option 4: the modulo (division) method is only one way of computing a hash, and it does not guarantee unique indices.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question