Tree Implementation in C++
This repository contains a basic implementation of a binary search tree in C++. The tree is implemented using templates, which makes it possible to use this data structure with any data type that supports the less-than operator (<). Features
Add an element to the tree (addElement)
Check if the tree contains a specific value (contains)
Remove an element from the tree (removeElement)
Display the tree in Preorder, Inorder and Postorder (display)
Get the maximum depth/height of the tree (maxDepth)
Installation
Clone the repository using the following command:
bash
git clone https://github.com/B3r3z/binary-search-tree
Compile and run the program using run.sh and cmake.
Usage
After running the main executable, the user is presented with a menu where they can choose to perform different operations on the tree. The user can add elements to the tree, check if an element is in the tree, remove an element from the tree, display the tree, and get the maximum depth of the tree. Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. License
This project is licensed under the MIT License. Copyright (c) Bartosz Berezowski