The REPL offers functionality for inserting, deleting, and searching within a red-black tree, along with the capability to generate an ASCII, or a graphical, representation of the tree structure in real-time.
After cloning this repository, install all the requirements with:
pip install -r requirements.txt
And run:
python3 main.py
To run the tests:
python3 -m pytest tests/*.py
The tree implementation was taken from Red-black tree implementation in Python , and the plotting code was taken from Implementation and Visualization of Red/Black Trees.