Multiple choice

Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statement(s) is/are true? (i) 9679, 1989, 4199 hash to the same value (ii) 1471, 6171 hash to the same value (iii) All elements hash to the same value (iv) Each element hashes to a different value

  1. (i) only

  2. (ii) only

  3. (i) and (ii)

  4. either (iii) or (iv)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Hash function x mod 10: 4322->2, 1334->4, 1471->1, 9679->9, 1989->9, 6171->1, 6173->3, 4199->9. (i) 9679, 1989, 4199 all hash to 9. (ii) 1471, 6171 both hash to 1. Both statements are true.