What is the purpose of a Hash Function in a Hash Table?
2024
What is the purpose of a Hash Function in a Hash Table?
- A.
It is used to store keys
- B.
It is used to compute an index into an array of buckets, to which the desired value is then appended
- C.
It is used to compare keys for equality
- D.
None of the above
Attempted by 193 students.
Show answer & explanation
Correct answer: B
The purpose of a hash function in a hash table is to compute an index into an array of buckets or slots, from which the desired value can be found.