https://github.com/icliberen/binary-heap-trees
Binary Search Tree, Balanced Binary Tree and Heap Implementations in C++
https://github.com/icliberen/binary-heap-trees
binarysearchtree binarytree binarytrees cpp heap heapsort heapsort-algorithm maxheap maxheaps minheap minheap-structure
Last synced: about 1 month ago
JSON representation
Binary Search Tree, Balanced Binary Tree and Heap Implementations in C++
- Host: GitHub
- URL: https://github.com/icliberen/binary-heap-trees
- Owner: icliberen
- License: gpl-3.0
- Created: 2025-03-16T21:30:31.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-31T11:57:00.000Z (about 1 month ago)
- Last Synced: 2025-03-31T12:34:35.348Z (about 1 month ago)
- Topics: binarysearchtree, binarytree, binarytrees, cpp, heap, heapsort, heapsort-algorithm, maxheap, maxheaps, minheap, minheap-structure
- Language: C++
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Binary Search Tree, Balanced Binary Tree and Heap Implementations in C++
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.---
## Features
- **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.---
## Prerequisites
- **For Building from Source:**
- [Visual Studio](https://visualstudio.microsoft.com/) (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---
## How to Run the Application
### Using Visual Studio
1. **Clone the Repository:**
```bash
git clone https://github.com/icliberen/binary-heap-trees.git### Using terminal
1. **Clone the Repository:**
```bash
git clone https://github.com/icliberen/binary-heap-trees.git2. **Compile the Code:**
```bash
g++ -o binary_heap_trees main.cpp4. **Run the Executable:**
On Linux or macOS:
```bash
./binary_heap_trees