Hi, I'm Hossam. This repository is a collection of my advanced C++ work, focusing on building systems from scratch without relying on pre-made STL libraries.
The highlight of this repo is SmartMart, a complete retail management system that simulates a real-world supermarket supply chain using Graphs, Heaps, and AVL Trees.
I wanted to build something that solves actual problems—like how to route a delivery driver efficiently or how to automatically discount expiring food.
Location: 04_SmartMart_Project/
-
The Database (AVL Tree): I couldn't just use a simple array for thousands of products. I built an AVL Tree to ensure searching for an item always takes
$O(\log n)$ time, even if the database is huge. - Delivery GPS (Graph + Dijkstra): The city is modeled as a weighted graph. When a user checks out, the system runs Dijkstra’s Algorithm to find the shortest path from the Warehouse to their specific zone.
- Discount Engine (Min-Heap): This is my favorite part. The system tracks expiry dates in a Priority Queue. The Admin can run a "nightly check" that instantly pops the items expiring soonest and applies a discount.
- The Cart (Doubly Linked List + Stack): The cart needs to be flexible (add/remove from anywhere), so I used a DLL. For the "Undo" button, I implemented a Stack to track user actions.
- Navigate to the project folder:
cd 04_SmartMart_Project - Compile the system:
g++ src/main.cpp -o app
- Run it:
./app
- Login Credentials:
- Admin: ID
1, Passwordadmin - Customer: ID
2, Password123
- Admin: ID
Beyond the main project, this repo contains my intensive study modules. Each folder focuses on a specific data structure where I implemented every major algorithm manually.
Everything is built from scratch using pointers.
- Linked Lists: Singly, Doubly, and Circular. Includes complex operations like MergeSort for Linked Lists and Floyd’s Cycle Detection.
- Stacks & Queues: Implementations include the "Monotonic Stack" (Next Greater Element) and a full Infix-to-Postfix expression parser.
Hierarchical data management.
- BST & General Trees: Includes logic for LCA (Lowest Common Ancestor), Tree Diameter, and Mirroring.
- AVL Trees: Full implementation of the 4 rotation cases (LL, RR, LR, RL) to keep the tree balanced.
- Heaps: A manual binary heap implementation used for sorting and priority queues.
Optimization problems.
- Sorting Engine: 6 different sorting algorithms (QuickSort, MergeSort, etc.) compared side-by-side.
- Graph Algorithms: BFS, DFS, and Cycle Detection for both directed and undirected graphs.
- C++ Memory Management: Heavy use of manual
new/deleteto prevent memory leaks. - Pointer Manipulation: Complex linking logic (especially in the Doubly Linked List and Graph adjacency lists).
- Algorithmic Thinking: Choosing the right structure for the right problem (e.g., Hash Table for fast logins vs. Heap for priority orders).
Thanks for checking out my code. If you have questions about the implementation of the Expiry Heap or the AVL rotations, feel free to reach out!