3 ms·
Trees require a lot more memory indirections than hashmaps, which makes them slower to traverse. They require a lot more interior pointers, which makes them big
by fanf2 2y ago
Trees require a lot more memory indirections than hashmaps, which makes them slower to traverse. They require a lot more interior pointers, which makes them bigger. It’s easy for a hashmap to beat a tree.
- globular-toast 2y agoNot in the worst case.
- sqeaky 2y agoWhich will be the developers responsibility to know when that is and is rarely the default or normal case.