Among the open-addressing (probing) collision-resolution techniques, which one…
2026
Among the open-addressing (probing) collision-resolution techniques, which one minimizes clustering (both primary and secondary) the most ?
- A.
Linear probing
- B.
Quadratic probing
- C.
Double hashing
- D.
Chaining
Show answer & explanation
Correct answer: C
Concept
In open addressing, when a key's home slot is already occupied, the table searches through a defined sequence of alternative slots until an empty one is found. Primary clustering is the tendency for these probe sequences to merge into long runs of occupied slots whenever the step size depends only on a fixed rule shared by every key, so that colliding keys are forced to follow an identical sequence of slots and the cluster grows every time another key joins it. Secondary clustering is a milder, related problem: even once different home slots are given different step sizes (so primary clustering is avoided), keys that happen to share the SAME home slot still take the identical step sequence as one another. A probing scheme minimizes clustering overall to the extent that the step it takes depends on the key itself, not merely on the home slot, so that even keys that collide at the same slot diverge onto different sequences.
Application
Linear probing takes a fixed step of 1 from the previous slot on every collision. Two keys that collide at the same slot therefore probe the exact same sequence of slots from that point onward, so runs of occupied slots merge and grow -- the classic primary-clustering behaviour.
Quadratic probing takes increasing squared steps (1, 4, 9, ...) from each key's own home slot. Keys with different home slots quickly diverge onto different slots, breaking up the long runs of primary clustering; but two keys that share the same home slot still trace the identical squared sequence as each other, which is the separate phenomenon called secondary clustering.
Double hashing computes its step size from a second, independent hash function applied to the key. Even two keys that share the same home slot typically get different step sizes from this second hash, so their probe sequences diverge onto different slots almost immediately. Because the step itself is key-dependent, not just the home slot, double hashing's probe sequences most closely approximate a uniformly random probing order, which minimizes both primary and secondary clustering more than linear or quadratic probing does.
Chaining does not probe the table at all: a collision is resolved by appending the key to an independent linked list (or bucket) attached to its home slot. Since no key is ever redirected to another table slot, there is no probe sequence to converge in the first place -- the phenomenon of primary clustering, which is specifically about probe-sequence behaviour in open addressing, does not arise under chaining.
Cross-check
Among the three open-addressing techniques offered, linear probing exhibits both primary and secondary clustering, since its fixed step and shared home slot force colliding keys onto one shared sequence. Quadratic probing removes primary clustering (different home slots diverge onto different slots quickly) but keeps secondary clustering, since keys sharing a home slot still follow the identical squared sequence as each other. Double hashing removes secondary clustering as well, because even keys sharing a home slot typically get different step sizes from the second hash function, so it minimizes clustering overall the most among the three. Chaining sidesteps clustering altogether through a different collision-resolution mechanism (external lists rather than in-table probing), so it is not a comparison point among the open-addressing techniques being compared here.
Hence, the hashing technique that minimizes clustering (both primary and secondary) the most, among the options offered, is double hashing.