OA. free
Free
Optym Core Computer Science Core Computer Science Medium

Two elements trying to occupy the same bucket in hash table is called as

Optym technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Two elements trying to occupy the same bucket in hash table is called as

Choose one option.
Show answer & explanation
Answer: A. A) Collision

In a hash table, when two distinct keys hash to the exact same bucket/index, it is called a hash collision.

Step-by-step Derivation:
Step 1: A hash function maps keys to array bucket indices: index = hash(key) % capacity.
Step 2: If key1 != key2 but hash(key1) == hash(key2), both try to occupy the same bucket.
Step 3: This event is defined as a collision.