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

B-trees don't beat hash tables at their own game, but hash tables don't beat B-trees at theirs either. Both are general-use data structures that have their particular niches. The trick is to always select the correct tool for the job.

You might be thinking about red-black trees. The size overhead of B-trees is the same or better than that of hash tables. As for cache friendliness, B-trees were explicitly designed to work great on two-level storage; the advantage is clearly theirs.



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

Search: