Skip to main contentSkip to solution

The ________ takes elements of the list one by one and generates an index value for every element.

Solution

✅ Correct Option: 1

A hash function takes each element (key) of the list one by one and computes an index value for it, usually as index=key mod table size\text{index} = \text{key} \bmod \text{table size}. That index tells us where the element will be stored.


Hash Table: the data structure that stores the elements at the indices the hash function produces. It does not generate the indices itself.

Collision: the situation where two different elements get the same index from the hash function.

Keyboard Shortcuts

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