Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on How to implement a hash table in C. Parent comment
If you use the terminology precisely, the worst case cost of a regular hash table insertion is O(n) because of the potential resize, but its amortized cost is O(1) because that's what it "averages out to".
There are no comments on this comment yet.
If you use the terminology precisely, the worst case cost of a regular hash table insertion is O(n) because of the potential resize, but its amortized cost is O(1) because that's what it "averages out to".