Skip to content
Related Articles

Related Articles

Data Structures | Hash | Question 5
  • Difficulty Level : Basic
  • Last Updated : 20 May, 2019
GeeksforGeeks - Summer Carnival Banner

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)


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

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :