What is a Red-Black Tree?
A red and black tree is similar to a Binary Search Tree but use a coloring system where a node can either be red or black. This introduces some rules but allows for more efficient insertions and deletions. This also allows the tree to be less lopsided.
Rules for Red-Black Trees
All rules should be followed before any additional insertions or deletions are made
- Nodes have to be black or red
- The Root will always be a black node
- The amount of black height should be equal on every path from a fixed node
- Red nodes cannot have a red child
Click here for more information on Red-Black Trees