A red-black tree is a kind of self-balancing binary search tree. The color ensures that the tree remains approximately balanced during insertions and deletions.
 

#python 

How to Building a Red-Black Binary Tree in Python
2.45 GEEK