3 ms·
I believe that using binary trees for hash chaining gives you better worst-case complexity but often worse performance in the common case. When your hashes are
by mikeash 15y ago
I believe that using binary trees for hash chaining gives you better worst-case complexity but often worse performance in the common case. When your hashes are reasonably well spread out and the buckets are chained at most a couple of items deep, the overhead of maintaining a binary tree versus a linked list or using open addressing can be a considerable hit.