🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: File Organization and Hashing: all 9 questions

Quiz: File Organization and Hashing · Question 8 of 9

Why can choosing a prime number of buckets help with h(k) = k mod M?

Why can choosing a prime number of buckets help with h(k) = k mod M?

  1. A.Keys that follow a pattern, such as all multiples of 4, are spread more evenly
  2. B.Prime numbers make division faster
  3. C.It removes the need for overflow blocks completely
  4. D.It allows range queries
Answer & explanation

Correct answer: Keys that follow a pattern, such as all multiples of 4, are spread more evenly

With M = 4, multiples of 4 all land in bucket 0; a prime M breaks that pattern.

Can you get the rest right without peeking?

Take the timed Quiz: File Organization and Hashing quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →