bstree-tango is a Python-based project that visualizes binary search trees. Experience the interplay between algorithms and UI, brought to you by bstree-tango!
🌳 Tango trees are a type of binary search tree (BST) introduced in computer science to optimize the number of rotations needed during search operations.
💃The main idea behind Tango trees is to maintain a dynamic set of preferred paths within the tree and perform rotations to ensure that the searched item is always within these preferred paths.
- Python >= 3.6
- Install necessary packages: The project requires several libraries which can be installed via pip. Here are the installation commands:
pip install pyautogui
pip install dash
pip install dash-html-components
pip install dash-core-components
pip install dash-table
For a step-by-step installation guide of Dash, please refer to the official Dash installation documentation.
- Running the Program: Once you've set up your environment, navigate to the directory containing
main.py
in your terminal or console and run the following command:
python main.py
❗️On the first run, the server might take a bit longer to start. Upon successful initiation, a local server address will appear. Copy and paste this address into your web browser to access the application.
-
Console Version: To test the console version, navigate to
console/tree/tests
and run thetester.py
file. This can be done either through the console (if Python is installed) or through any preferred IDE. There's a template within to guide you in creating test file names. The tester will alert you if search results don't match expectations. Test template format: count of numbers, range, actual numbers (sample tests are provided in the directory). -
GUI Version: For the version with a user interface, navigate to the
GUI
directory and runmain.py
. It's easiest to run this using PyCharm, which will handle the necessary setups for you.
- There seem to be issues deploying the project on Heroku due to missing event-driven libraries. Until resolved, deploying the project on Heroku may not be possible.
This project is licensed under the MIT License. See the LICENSE.md file for details.