Red Black Trees

Definiton

A red-black tree is a self-balancing binary search tree where each node is colored either red or black

Attributes of Red Black Trees

  1. Every node is either red or black
  2. Every path from a node to a descendant leaf contains the same number of black nodes
  3. If a node is red, then both its children are black, and all leaf nodes are black

Red Black Tree Example

Red Black Tree Example

More Information on Red Black Trees

visit to learn more about red black trees