# mahmoudplay/cpp-dsa architecture

> Architecture diagram of the GitHub repository mahmoudplay/cpp-dsa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahmoudplay/cpp-dsa
- Repository: https://github.com/mahmoudplay/cpp-dsa

## Overview

This repository is a collection of standalone C++ data-structure and introductory programming exercises, not a single integrated application. Its user-facing workflow is interactive console input, followed by an exercise-specific operation and printed output: array calculations and edits, board games, linked-list operations, stack operations, or quiz calculations. The README provides no further product detail. The graph reflects the sampled programs and indexed files; unsampled exercises are represented only where their paths and purpose are evident from the tree.

Main entry points: [`assigment 1/connect.cpp`](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/connect.cpp) (Connect Four), [`assigment 1/xo.cpp`](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/xo.cpp) (Tic Tac Toe), [`assignment 3/lnkedlist.cpp`](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlist.cpp) (Basic List Menu), [`assignment 3/lnkedlistEvo.cpp`](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlistEvo.cpp) (Extended List Menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arrays["Array Exercises"]
  node_array1d["1D Array<br/>[1dim.cpp]"]
  node_array2d["2D Array<br/>[2dim.cpp]"]
  node_matrix["Matrix Exercise<br/>[matrix.cpp]"]
  node_arrayedit["Array Insert Remove<br/>[insert.cpp]"]
end

subgraph group_games["Board Games"]
  node_connect["Connect Four<br/>[connect.cpp]"]
  node_connectboard["Board And Rules<br/>[connect.cpp]"]
  node_connectcomputer["Random Computer Move<br/>[connect.cpp]"]
  node_tictactoe["Tic Tac Toe<br/>[xo.cpp]"]
  node_xoengine["Board And Rules<br/>[xo.cpp]"]
  node_xocomputer["Random Computer Move<br/>[xo.cpp]"]
end

subgraph group_lists["Linked Lists"]
  node_listbasic["Basic List Menu<br/>[lnkedlist.cpp]"]
  node_listbasicdata["List Operations<br/>[lnkedlist.cpp]"]
  node_listevolved["Extended List Menu<br/>[lnkedlistEvo.cpp]"]
  node_listevolveddata["Extended List Operations<br/>[lnkedlistEvo.cpp]"]
end

subgraph group_stacks["Stack Exercises"]
  node_stackbasic["Array Stack Menu<br/>[stack.cpp]"]
  node_stackadvancedarray["Advanced Array Stack Menu"]
  node_stackadvancedlist["Linked Stack Menu"]
  node_stackimplementations["Stack Implementations<br/>[stack.h]"]
end

subgraph group_quizzes["Quiz Programs"]
  node_quizg1["Diagonal Quiz G1<br/>[quiz_g1.cpp]"]
  node_quizg2["Diagonal Quiz G2<br/>[quiz_g2.cpp]"]
end

node_user(("Console User"))

node_user -.->|"enters input"| node_array1d
node_user -->|"enters input"| node_array2d
node_user -->|"chooses operation"| node_arrayedit
node_user -->|"plays game"| node_connect
node_user -->|"plays game"| node_tictactoe
node_user -->|"chooses operation"| node_listbasic
node_user -->|"chooses operation"| node_listevolved
node_user -->|"chooses operation"| node_stackbasic
node_user -->|"chooses operation"| node_stackadvancedarray
node_user -->|"chooses operation"| node_stackadvancedlist
node_user -->|"runs exercise"| node_quizg1
node_user -->|"runs exercise"| node_quizg2
node_user -.->|"runs exercise"| node_matrix
node_connect -->|"updates and checks"| node_connectboard
node_connect -->|"requests move"| node_connectcomputer
node_connectcomputer -->|"checks valid columns"| node_connectboard
node_tictactoe -->|"updates and checks"| node_xoengine
node_tictactoe -->|"requests move"| node_xocomputer
node_xocomputer -->|"checks empty cells"| node_xoengine
node_listbasic -->|"calls list operations"| node_listbasicdata
node_listevolved -->|"calls list operations"| node_listevolveddata
node_stackadvancedarray -->|"uses stack class"| node_stackimplementations
node_stackadvancedlist -->|"uses stack class"| node_stackimplementations

click node_array1d "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/1dim.cpp"
click node_array2d "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/2dim.cpp"
click node_matrix "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/matrix.cpp"
click node_arrayedit "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%202/insert.cpp"
click node_connect "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/connect.cpp"
click node_connectboard "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/connect.cpp"
click node_connectcomputer "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/connect.cpp"
click node_tictactoe "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/xo.cpp"
click node_xoengine "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/xo.cpp"
click node_xocomputer "https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/xo.cpp"
click node_listbasic "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlist.cpp"
click node_listbasicdata "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlist.cpp"
click node_listevolved "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlistEvo.cpp"
click node_listevolveddata "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlistEvo.cpp"
click node_stackbasic "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/stack.cpp"
click node_stackadvancedarray "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/Advenced/stackArrAdvenced.cpp"
click node_stackadvancedlist "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/Advenced/stackLinkedListAdvenced.cpp"
click node_stackimplementations "https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/Advenced/stack.h"
click node_quizg1 "https://github.com/mahmoudplay/cpp-dsa/blob/main/quiz%201/G1/quiz_g1.cpp"
click node_quizg2 "https://github.com/mahmoudplay/cpp-dsa/blob/main/quiz%201/G2/quiz_g2.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_array1d,node_array2d,node_matrix,node_arrayedit,node_user toneBlue
class node_connect,node_connectboard,node_connectcomputer,node_tictactoe,node_xoengine,node_xocomputer toneAmber
class node_listbasic,node_listbasicdata,node_listevolved,node_listevolveddata toneMint
class node_stackbasic,node_stackadvancedarray,node_stackadvancedlist,node_stackimplementations toneRose
class node_quizg1,node_quizg2 toneIndigo
```

## Components

### Array Exercises

- [1D Array](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/1dim.cpp): `assigment 1/1dim.cpp`
- [2D Array](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/2dim.cpp): `assigment 1/2dim.cpp`
- [Matrix Exercise](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/matrix.cpp): `assigment 1/matrix.cpp`
- [Array Insert Remove](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%202/insert.cpp): `assignment 2/insert.cpp`

### Board Games

- [Connect Four](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/connect.cpp): `assigment 1/connect.cpp`
- [Board And Rules](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/connect.cpp): `assigment 1/connect.cpp`
- [Random Computer Move](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/connect.cpp): `assigment 1/connect.cpp`
- [Tic Tac Toe](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/xo.cpp): `assigment 1/xo.cpp`
- [Board And Rules](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/xo.cpp): `assigment 1/xo.cpp`
- [Random Computer Move](https://github.com/mahmoudplay/cpp-dsa/blob/main/assigment%201/xo.cpp): `assigment 1/xo.cpp`

### Linked Lists

- [Basic List Menu](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlist.cpp): `assignment 3/lnkedlist.cpp`
- [List Operations](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlist.cpp): `assignment 3/lnkedlist.cpp`
- [Extended List Menu](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlistEvo.cpp): `assignment 3/lnkedlistEvo.cpp`
- [Extended List Operations](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%203/lnkedlistEvo.cpp): `assignment 3/lnkedlistEvo.cpp`

### Stack Exercises

- [Array Stack Menu](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/stack.cpp): `assignment 4/stack.cpp`
- [Advanced Array Stack Menu](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/Advenced/stackArrAdvenced.cpp): `assignment 4/Advenced/stackArrAdvenced.cpp`
- [Linked Stack Menu](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/Advenced/stackLinkedListAdvenced.cpp): `assignment 4/Advenced/stackLinkedListAdvenced.cpp`
- [Stack Implementations](https://github.com/mahmoudplay/cpp-dsa/blob/main/assignment%204/Advenced/stack.h): `assignment 4/Advenced/stack.h`

### Quiz Programs

- [Diagonal Quiz G1](https://github.com/mahmoudplay/cpp-dsa/blob/main/quiz%201/G1/quiz_g1.cpp): `quiz 1/G1/quiz_g1.cpp`
- [Diagonal Quiz G2](https://github.com/mahmoudplay/cpp-dsa/blob/main/quiz%201/G2/quiz_g2.cpp): `quiz 1/G2/quiz_g2.cpp`

### Other components

- **Console User**

## Connections

- Console User → 1D Array: enters input
- Console User → 2D Array: enters input (evidence: `assigment 1/2dim.cpp`)
- Console User → Array Insert Remove: chooses operation (evidence: `assignment 2/insert.cpp`)
- Console User → Connect Four: plays game (evidence: `assigment 1/connect.cpp`)
- Console User → Tic Tac Toe: plays game (evidence: `assigment 1/xo.cpp`)
- Console User → Basic List Menu: chooses operation (evidence: `assignment 3/lnkedlist.cpp`)
- Console User → Extended List Menu: chooses operation (evidence: `assignment 3/lnkedlistEvo.cpp`)
- Console User → Array Stack Menu: chooses operation (evidence: `assignment 4/stack.cpp`)
- Console User → Advanced Array Stack Menu: chooses operation (evidence: `assignment 4/Advenced/stackArrAdvenced.cpp`)
- Console User → Linked Stack Menu: chooses operation (evidence: `assignment 4/Advenced/stackLinkedListAdvenced.cpp`)
- Console User → Diagonal Quiz G1: runs exercise (evidence: `quiz 1/G1/quiz_g1.cpp`)
- Console User → Diagonal Quiz G2: runs exercise (evidence: `quiz 1/G2/quiz_g2.cpp`)
- Console User → Matrix Exercise: runs exercise
- Connect Four → Board And Rules: updates and checks (evidence: `assigment 1/connect.cpp`)
- Connect Four → Random Computer Move: requests move (evidence: `assigment 1/connect.cpp`)
- Random Computer Move → Board And Rules: checks valid columns (evidence: `assigment 1/connect.cpp`)
- Tic Tac Toe → Board And Rules: updates and checks (evidence: `assigment 1/xo.cpp`)
- Tic Tac Toe → Random Computer Move: requests move (evidence: `assigment 1/xo.cpp`)
- Random Computer Move → Board And Rules: checks empty cells (evidence: `assigment 1/xo.cpp`)
- Basic List Menu → List Operations: calls list operations (evidence: `assignment 3/lnkedlist.cpp`)
- Extended List Menu → Extended List Operations: calls list operations (evidence: `assignment 3/lnkedlistEvo.cpp`)
- Advanced Array Stack Menu → Stack Implementations: uses stack class (evidence: `assignment 4/Advenced/stackArrAdvenced.cpp`)
- Linked Stack Menu → Stack Implementations: uses stack class (evidence: `assignment 4/Advenced/stackLinkedListAdvenced.cpp`)
