GATE CS 2023 | Question 20
Algorithms › Hashing · MCQ · 1 mark · Answer: C
- Question 20Algorithmsmcq1 markAn adversary generates keys to maximize collisions in a hash table ( keys, slots, ). Which is the best hashing strategy?
- A.Division method h(k)=k mod m.
- B.Multiplication method.
- C.Universal hashing method.✓
- D.If k is prime use Division, else Multiplication.
Answer: C
Solution
Answer: (C) Universal hashing method For any fixed hash function (division or multiplication), an adversary who knows it can choose keys that all collide. Universal hashing picks the hash function randomly from a family, so no adversary (choosing keys before the function is drawn) can force many collisions — the expected number of collisions is bounded. - A.
More GATE PYQ on Hashing
All GATE CS Algorithms PYQ →Attempt GATE CS 2023 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →