Skip to content

This repository offers a robust implementation of an AVL tree (balanced binary search tree) in Python, encapsulated within the Node and Tree classes. It includes methods for building the tree (build_tree()), inserting nodes (insert()), and deleting nodes (delete()). The implementation ensures that the tree remains balanced, optimizing performance.

License

Notifications You must be signed in to change notification settings

sminerport/BalancedTreeLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

BalancedTreeLib

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.

Features

  • 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.

Getting Started

  1. Clone the repository: git clone https://github.com/sminerport/BalancedTreeLib.git
  2. Navigate to the repository folder: cd BalancedTreeLib
  3. Run the main script: python main.py

Dependencies

  • Python 3.x

Contributing

Contributions are welcome! Feel free to submit a pull request or report any issues you encounter.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

This repository offers a robust implementation of an AVL tree (balanced binary search tree) in Python, encapsulated within the Node and Tree classes. It includes methods for building the tree (build_tree()), inserting nodes (insert()), and deleting nodes (delete()). The implementation ensures that the tree remains balanced, optimizing performance.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages