While hashing 5 integer keys namely 5, 12, 23, 32, 104 using the hash function…

2026

While hashing 5 integer keys namely 5, 12, 23, 32, 104 using the hash function h(key) = key % 10 into a hash table with 10 buckets the number of keys that will collide is

  1. A.

    0

  2. B.

    1

  3. C.

    2

  4. D.

    3

Attempted by 159 students.

Show answer & explanation

Correct answer: C

Keys hashed: 5->5, 12->2, 23->3, 32->2, 104->4. Keys 12 and 32 collide at bucket 2. Total keys involved in collision is 2.

Explore the full course: Niacl Ao It Specialist