Hacker News new | past | comments | ask | show | jobs | submit login

Under what conditions will a B-tree out perform a hash map? Seems like the hash map was far and away the better choice in his test.



For insertions and lookup it is probably hard to find a situation (for large n hashes are asymptotically superior).

Trees provide some other nice properties such as maintaining an ordering (so it's fast to get the smallest argument or interate of the elements in numerical order) and always perform at the asymptotic time cost (a dynamic hash table occasionally takes O(n) when the table is resized so it might not be a good fit in a realtime situation)




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

Search: