Skip to main contentSkip to solution

If every item of the list maps to a unique index in the hash table, then the hash function will be called as ________.

Solution

✅ Correct Option: 1

A hash function that maps every item in the list to a unique index, with no two items sharing a slot, is called a perfect hash function. Since there are no collisions, each lookup takes constant time O(1)O(1).


Options 2, 3 and 4: "correct", "super" and "right" are not standard terms in hashing.

A perfect hash function needs the set of keys to be known in advance. A minimal perfect hash function also uses a table of exactly the same size as the number of keys.

Keyboard Shortcuts

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