/RBT

Implementation of Red-Black Tree using Python3

Primary LanguagePython

RBT

Implementation of Red-Black Tree using Python3.

RBT

RBT (Red Black Tree) is a binary search tree which has the following red-black properties:

  • Every node is either red or black.
  • Every leaf (NULL) is black.
  • If a node is red, then both its children are black.
  • Every simple path from a node to a descendant leaf contains the same number of black nodes

Red-black_tree_example svg

Implementation

The current implementation pretty standard. Each node in the tree contains a numeric (int/double) value and you can create an RBTree and add items (with no duplicates). The implementation is based upon:

To-Do

  • Implement deletion of nodes
  • Improve the current UnitTests (add more compilcated scenarios)
  • Update the tree to hold any data, no only numeric values