Data Structures: Difference between revisions

No edit summary
Line 39: Line 39:
If the left child has <math>m</math> levels then at most the right child can have <math>2m</math> levels.
If the left child has <math>m</math> levels then at most the right child can have <math>2m</math> levels.


Intuitively, this is more relaxed than AVL trees so they will have fewer operations for insert/delete but will be less balanced.<br>
Intuitively, this is more relaxed than AVL trees so they will have fewer operations for insert/delete but will be less balanced (i.e. longer search).<br>
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).