A comprehensive collection of template-based C++ implementations for fundamental data structures and algorithms. This library provides reusable, generic components for Stacks, Queues, Trees, Graphs, and Sorting algorithms, designed for educational understanding and modular application.
The project is organized into header files (.hpp) for reusable templates and demonstration source files (.cpp).
Stack.hpp: Dynamic stack implementation using a Linked List.FixedSizeStack.hpp: Static stack implementation using a Dynamic Array with a fixed capacity.Queue.hpp: Dynamic queue implementation using a Linked List (FIFO).List.hpp: A Singly Linked List implementation (primarily used as a helper for the Graph adjacency list).
BST.hpp: A Dictionary-style Binary Search Tree storing Key-Value pairs (K,V). Supports recursive/iterative insertion and deletion.PriorityQueue.hpp: A Max-Priority Queue implemented using a Binary Heap (Array-based).Binary Search Tree.hpp: A basic BST implementation focusing on simple keys (alternative toBST.hpp).
Graph.hpp: An Adjacency List implementation of a Graph.- Supports loading graph data from a file.
- Includes BFS (Breadth-First Search) and DFS (Depth-First Search) traversal algorithms.
- Dependencies: Requires
Queue.hpp,Stack.hpp, andList.hpp.
HeapSort.hpp: Implementation of the Heap Sort algorithm using generic arrays.heap.cpp: A standalone demonstration file showing the logic offixUp(sift up) andfixDown(sift down) heap operations.
All data structures (except heap.cpp) are implemented as C++ Templates, allowing them to handle any data type (e.g., int, float, std::string, or custom objects).
#include "Stack.hpp"
#include "FixedSizeStack.hpp"