Red Black Trees
Highlighting a few important rules on Red Black Trees
Red Black Tree Rules:
- Red children with red parents are NOT allowed
- The black heights (number of black nodes) from the root node to each leaf node should be the same
- The root node must always be black
- When adding a node and coming across a red-red violation, check the child's aunt node to resolve
- When deleting a black node, replace the deleted node with a double black node and check the sibling node to resolve
An image of a valid Red Black Tree