GATE CS 2015, set 2 · Question 50 · Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer
Which one of the following hash functions on integers will distribute keys most uniformly over 10 buckets numbered 0 to 9 for i ranging from 0 to 2020?
- (A) h(i) = i² mod 10
- (B) h(i) = i³ mod 10
- (C) h(i) = (11 * i²) mod 10
- (D) h(i) = (12 * i) mod 10
Answer
Answer (B)
Answer from the official GATE CS 2015 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes