Data Structures: Difference between revisions

Line 42: Line 42:
Red-black trees are used in in C++ (ordered_map, ordered_set) and Java (TreeMap, TreeSet).
Red-black trees are used in in C++ (ordered_map, ordered_set) and Java (TreeMap, TreeSet).


====Complexity===
====Complexity====
<math>2\log (n+1)</math> height.<br>
<math>2\log (n+1)</math> height.<br>
<math>O(\log n)</math> insert, delete
<math>O(\log n)</math> insert, delete