Skip to content

hossaamwer/cpp-dsa-capstone

Repository files navigation

SmartMart Logistics & Data Structures Portfolio

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.


The Capstone: SmartMart System

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/

How it works under the hood:

  • 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.

How to Run SmartMart:

  1. Navigate to the project folder:
    cd 04_SmartMart_Project
  2. Compile the system:
    g++ src/main.cpp -o app
  3. Run it:
    ./app
  4. Login Credentials:
    • Admin: ID 1, Password admin
    • Customer: ID 2, Password 123

Deep Dive: Core Data Structures

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.

01_Linear_Structures

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.

02_Tree_Structures

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.

03_Algorithms_Graphs

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.

Technical Skills Demonstrated

  • C++ Memory Management: Heavy use of manual new/delete to 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!

About

Coursework archive for Advanced Data Structures & Algorithms. Contains manual implementations of core structures (Trees, Linked Lists, Sorting) and a final capstone project demonstrating practical application of these concepts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages