This repository contains the code for implementing an AVL tree (balanced binary search tree) in Python, with additional functionality for logging operations and visualizing the tree structure. The implementation includes the Node
and Tree
classes, methods for building, inserting, deleting, and rebalancing the tree, and a Logger
class for capturing program output.
- Node Class: Includes attributes for the key value, parent node, left and right children, and height.
- Tree Class: Provides methods for constructing a balanced binary search tree from a list of items, inserting and deleting nodes, and ensuring the tree remains balanced.
- Logging: Captures program output and logs it to a file for easy debugging and review.
- Tree Visualization: Generates a visual representation of the AVL tree for easy inspection.
- Clone the repository:
git clone https://github.com/sminerport/BalancedTreeLib.git
- Navigate to the repository folder:
cd BalancedTreeLib
- Run the main script:
python main.py
- Python 3.x
Contributions are welcome! Feel free to submit a pull request or report any issues you encounter.
This project is licensed under the MIT License. See the LICENSE file for more information.