This project demonstrates multiple tree-based data structures in C++:
-
Binary Search Tree (BST):
- Supports insertion, deletion and a visual display (both balanced and level order).
- Displays the maximum element along with its level.
-
Balanced Binary Tree:
- Uses a balanced insertion method.
- Allows deletion of the last inserted element.
- Displays the tree and checks properties such as full, complete and perfect.
-
Heap:
- Implements both MinHeap and MaxHeap functionalities.
- Visualizes the heap as a tree with
/
and\
representing parent-child connections. - Allows dynamic switching between MinHeap and MaxHeap even after creation.
- Insertion & Deletion: Easily add and remove elements in each data structure.
- Visual Display:
- Structured top-down visualization for both trees and heap.
- Level order (BFS) traversal for BST.
- Heap Type Switching:
- Change between min-heap and max-heap on the fly.
- Tree Property Analysis: Check if binary trees are full, complete or perfect.
- Robust Input Handling: Ensures only valid integer inputs are accepted.
-
For Building from Source:
- Visual Studio (2019 or later with C++ development)
- Alternatively, a C++ compiler such as
g++
(for command-line builds)
-
For Running Pre-Built Releases:
- No development tools required, just the executable for windows operating system
- Clone the Repository:
git clone https://github.com/icliberen/binary-heap-trees.git
-
Clone the Repository:
git clone https://github.com/icliberen/binary-heap-trees.git
-
Compile the Code:
g++ -o binary_heap_trees main.cpp
-
Run the Executable:
On Linux or macOS:
./binary_heap_trees