Practice mode Data Structures

What is a collision in a hash table?

Correct answer D. Two different keys hash to the same index

Explanation

A hash function maps a large key space into a small number of slots, so distinct keys inevitably sometimes land in the same slot; that is a collision. Every practical hash table needs a resolution strategy, such as separate chaining or open addressing with probing. Inserting a duplicate key is normally treated as an update, not a collision.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.