Data Structures | Hash | Question 5

Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statements 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
(GATE CS 2004)
(A) i only
(B) ii only
(C) i and ii only
(D) iii or iv


Answer: (C)

Explanation:

Hash function given is mod(10).
9679, 1989 and 4199 all these give same hash value i.e 9
1471 and 6171 give hash value 1 


Quiz of this Question



My Personal Notes arrow_drop_up

Improved By : UzairGhauri