Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

People keep skipping a word and a qualifier. The precise description is "hash tables with appropriately chosen growth condition have amortised insert cost of O(1)". The amortised bit effectively hides the occasional rehashing. (It's about throughput, not latency)


Rehashing can be done incrementally; aside from the additional memory allocation, incremental rehashing can be O(1) rather than O(n).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: