This project is a Custom C++ Standard Template Library (STL) implementation that includes Vector, String, Map, Set, Stack, Queue, Priority Queue, and Deque. It’s built from scratch to deepen understanding and improve efficiency in common operations. Notable optimizations include a circular array for Vector (fast front push/pop) and KMP for substring search.
- Vector — dynamic array using a circular buffer for efficient front/back ops
- String — custom string with manipulation utilities and KMP substring search
- Map / Set — unique keys/elements with efficient insert/find/erase
- Stack / Queue / Deque — classic LIFO/FIFO and double-ended structures
- Priority Queue — heap-based ordering by priority
- KMP Substring Search: O(n + m) pattern matching (faster than naive).
Prerequisites: C++17+ compiler (g++/clang++/MSVC)
# 1) Clone and enter
git clone https://github.com/Aarush289/My-STL-Project.git
cd My-STL-Project
# 2) Build & run a demo
# Linux/macOS (Bash/zsh):
mkdir -p build
g++ -std=gnu++17 -O2 -Wall -Wextra -Iinclude examples/all_examples.cpp -o build/demo && ./build/demo
# Windows (PowerShell) — if using MinGW:
# mkdir build
# g++ -std=c++17 -O2 -Wall -Wextra -Iinclude examples/all_examples.cpp -o build/demo.exe ; ./build/demo.exe
# Windows (MSVC cl.exe, from "Developer Command Prompt for VS"):
# mkdir build
# cl /std:c++17 /O2 /I include examples\all_examples.cpp /Fe:build\demo.exe && build\demo.exe