Red black tree

Self balancing binary tree (nodes are sorted) that guarantees the ration between longer and shorter branches is < 2 Nodes are colored in 2 colors so that the following rules are always respected

Nodes to add are red but can change color depending on tree configuration, many cases to handle in order to keep the properties after insertion/removal. To keep color properties, insertion and removalof nodes may trigger rotations on branches of the tree (3 maximum per operation) => properties kept = balanced tree

Heaps

Any tree data structure in which there is an order between the parent node and all its descendants (greater/less than…). There is no constraint on the order of siblings (contrary to a binary tree for example).

Data_St_Black_Red_Tree.svg Data_St_Heap_Structure.svg