Skip to main contentSkip to solution

Which of the following is not the technique to calculate index in hashing?

Solution

✅ Correct Option: 4

Collision is not a technique for calculating an index. It is a problem that occurs when two different keys map to the same index. It is handled afterwards by collision resolution methods such as chaining or open addressing.

Integer division, modulo division and the mid-square function are all hash functions that compute an index from a key.


Options 1, 2 and 3: each one is a genuine hash function, so each one is a technique for calculating an index.

Mid-square squares the key and takes the middle digits as the index.

Keyboard Shortcuts

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