| ▲ | kstrauser 6 hours ago | |
Nitpick: it’s still going to collide when taking the modulo to decide what bucket to put it in. If you know that the hashmap has 1000 buckets, and you spam it with multiples of 1000, you could make it put every key into the same bucket and have O(1) lookups turn into O(n). That doesn’t happen with real hash functions with random seeds. | ||
| ▲ | xnorswap 6 hours ago | parent [-] | |
Oh right, got you. | ||