RBT / Red Black Trees

A red black tree is a balanced binary search tree that was taught in CS400.

Important Rules for RBT to be true

  1. Each node has to be red or black
  2. The root is always black
  3. No red node has a red child
  4. All routes lead to the same null branch

Why people use it instead of regular BST

It keeps operations faster. Has a time complexity of usually O(log n).

Click here for more information