← 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?
- A.Keys that follow a pattern, such as all multiples of 4, are spread more evenly
- B.Prime numbers make division faster
- C.It removes the need for overflow blocks completely
- 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 →