Red-Black Tree

What is a Red-Black Tree?

A Red-Black tree is a self-balancing binary search tree that efficiently manages ordered data for quick storage and retrieval.

Properties of Red-Black Tree

  1. Every node is either red or black.
  2. All NIL nodes are considered black.
  3. A red node does not have a red child.
  4. Every path from a given node to any of its descendant NIL nodes goes through the same number of black nodes.
Want to learn more?