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

You can have preallocated buckets in an array. What's the difference you ask? When you have more elements per buckets, the variance becomes smaller as a fraction of the bucket's size. Imagine you had a hash table with buckets of 1000 elements. You'd probably feel comfortable with a 90% load even without any strategy to handle bucket overflow except growing and rehashing. Obviously, the downside is that we have to do more work to search in buckets.


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

Search: