What does HASHING function do?
What does HASHING function do?
Solution
A hash function takes a key and applies a formula to it, such as , to calculate the position (index) in the hash table where the key is stored or searched. This gives direct access to the key without scanning the list, so search takes time on average.
Option 1: this describes linear search, which checks elements one by one.
Option 3: this describes searching in a sorted list, as in binary search, which uses comparisons and not a formula.
Option 4: mapping different keys to the same slot is a collision, which is an undesirable outcome that a good hash function tries to minimise, not what it is meant to do.
Related questions:
2025: 13 May Shift 2
2026: 31 May Shift 1
2026: 11 May Shift 2
2026: 23 May Shift 2
2026: 23 May Shift 2