c++ - Does any stl::set implementation not use a red-black tree? -



c++ - Does any stl::set implementation not use a red-black tree? -

has seen implementation of stl stl::set not implemented red-black tree?

the reason inquire that, in experiments, b-2b trees outperform stl::set (and other red-black tree implementations) factor of 2 4 depending on value of b. i'm curious if there compelling reason utilize red-black trees when there appear faster info structures available.

some folks on @ google built b-tree based implementation of c++ standard library containers. seem have much improve performance standard binary tree implementations.

there catch, though. c++ standard guarantees deleting element map or set invalidates other iterators pointing same element in map or set. b-tree based implementation, due node splits , consolidations, erase fellow member functions on these new structures may invalidate iterators other elements in tree. result, these implementations aren't perfect replacements standard implementations , couldn't used in conformant implementation.

hope helps!

c++ data-structures stl b-tree red-black-tree

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -