This repository contains a Python implementation of a Binary Search Tree (BST) along with example scripts demonstrating its functionalities.
This repository contains a Python implementation of a Binary Search Tree (BST). It includes functionalities such as insertion, in-order traversal, searching, finding the maximum element, and calculating the sum of all elements.
BinaryTree.py
: Implementation of theBinarySearchTreeNode
class and related functions.main.py
: Example script demonstrating usage of the BST functionalities.README.md
: Overview of the project, usage instructions, and contributions.
-
Setup:
- Clone the repository:
git clone https://github.com/Onesmus-dev/Python-implementation-of-a-Binary-Search-Tree-.git
- Navigate to the directory:
cd Python-implementation-of-a-Binary-Search-Tree-
- Clone the repository:
-
Run the Example Script:
- Execute the example script:
python main.py
- Execute the example script:
-
Output:
- The script demonstrates construction of a BST, in-order traversal, searching, finding the maximum element, and calculating the sum of elements.
Contributions and feedback are welcome! Feel free to fork the repository and submit pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.