3 ms·
I think it comes down to complexity. Scanning is O(N) where N is the number of buckets, two random choices is O(1) (if bucket lookup is O(1), e.g. a hash map).
by movpasd 3y ago
I think it comes down to complexity. Scanning is O(N) where N is the number of buckets, two random choices is O(1) (if bucket lookup is O(1), e.g. a hash map).
- magicalhippo 3y agoYes exactly. You approximate the full algorithm while not paying the overhead.