logoalt Hacker News

monkeyelitelast Wednesday at 12:20 AM1 replyview on HN

If we look at the major standard libraries for hash tables, you're telling me there will be no overhead to supporting the ability to delete keys?

Isn't resizing logic already a counterexample?


Replies

dwatttttlast Wednesday at 4:20 AM

Resizing has to happen regardless of the ability to delete a key, unless you know upfront how many entries you're going to add; I'd be much more worried about a home grown hash table's tuning to rebalance itself at say, 80% buckets full.

If you _do_ know how many entries you're going to be adding upfront, you probably don't even want a hash table, you're probably better off with an array!

show 1 reply