Red-Black Properties
These are the properties that need to be maintained for a Red-Black Tree to work correctly (from CLRS).
- Every Node is either Red or Black.
- The Root is Black.
- Every Leaf (Nil) is Black.
- If a Node is Red then both of its children are Black.
- For each Node, all simple paths from the node to descendant leaves contain the same number of Black Nodes.
When the properties are true the height of a tree with n nodes is \(O(\log(n))\).