Conversation

Attention CSEd Twitter: While Big-O matters, the constant-factors involved in things like cache-hit rate are at least as important. If you're teaching balanced-binary-trees for any reason other than tradition, I'd love to chat.
19
224
Pointer chasing to new allocations for “structural data” is one reason why set, map and list are bad. sorted vector is a good middle ground for larger set sizes and low insert frequency, (std::vector with std::lower_bound). Memory order is reduced to the “actual data”.
1
1
It should be noted that std::map and std::set are not representative of self-balancing search trees overall. They force an inefficient implementation for modern hardware due to the iterator invalidation guarantees. B-trees are a great data structure but the API doesn't allow it.
1
2
B-trees are ordered data structures providing O(log n) find, insert and delete while also having great data locality at the same time. The node size can be increased or decreased to tune performance. Great data locality is why they're so broadly used by databases / filesystems.
3
2
Show replies