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
A good reason to use a red-black tree is for intrusive data structures where the nodes are going to be threaded through existing objects, often as a way of designing around avoiding dynamic allocation. It's a useful approach in memory allocators, kernels and robust libraries.
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