# sachingoyal94/dsa architecture

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

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

## Overview

##### Project Type and Purpose
- This is an open-source educational repository of Data Structures & Algorithms (DSA) implementations in C and C++.
- Purpose: provide organized, topic-based code examples and executables to help learners explore, compile, and run DSA problems.

##### High-Level Architecture Components
a. Developer Workspace
- Version Control (Git)
- IDE/Editor (e.g., VSCode with `.vscode` settings)
b. Code Modules (monorepo structured by topic)
- “1 Basics”, “2 Algorithms”, “3 Arrays”, …, “20_graphs”, “100 leetcode and Gfg”, “1000 Current”
- Each module holds `.cpp` (or `.c`) source files + optional `output` subfolder with compiled binaries.
c. Build System
- Native C++ compiler (g++/clang++) invoked per directory or via scripts.
- Optionally wrap in a simple Makefile or CMakeLists.txt for consistency.
d. Execution Artifacts
- Executable binaries (`*.exe`) placed alongside or under `output/`.
- Temporary files (e.g., `tempCodeRunnerFile.cpp`) used during development.
e. Documentation
- `README.md` at root explaining repository structure, usage, contribution guidelines.
- License file (`LICENSE`).
f. Continuous Integration (optional future component)
- Automated builds/tests on PRs (GitHub Actions, Travis CI).

##### Relationships & Data Flows
- Developer → Clone/Checkout → Local Workspace
- IDE or CLI → Source Modules → Build System → Executables
- Executables → Run/Test → Console Output
- New contributions → Code Review → Merge → Updated Documentation → CI (future)

##### Architectural Patterns & Principles
- Modular decomposition: each topic is a module to isolate concerns and ease navigation.
- Convention over configuration: each folder follows consistent naming (`<topic>/<problem>.cpp`).
- Build “directory‐locality”: source files and their outputs co-locate for clarity.
- Minimal dependencies: only standard STL and standard C++ compiler—zero external libraries.

- Developer Environment
- Version Control (GitHub)
- Topic Modules
- Build System (g++, Make/CMake)
- Documentation (README, LICENSE)
- Executables / Output
- Developer commits → GitHub
- GitHub clone → IDE
- IDE invokes Build → Compiled binaries
- Binaries produce console output
c. Visual Distinctions
– Blue for code modules
– Green for build tools
– Orange for outputs/artifacts
– Grey for documentation/version control
– Rectangles for directories/modules
– Parallelograms for documentation files.
d. Labels

##### Detail
- Topic folder is represented or abstracted as a module.
- Pairing of source (`*.cpp`) and its compiled output.
- End-to-end developer flow from code browsing to execution.

## Diagram (Mermaid)

```mermaid
flowchart TB
    classDef code fill:#cce5ff,stroke:#333,stroke-width:1px;
    classDef build fill:#d4edda,stroke:#333,stroke-width:1px;
    classDef outputs fill:#fff3cd,stroke:#333,stroke-width:1px;
    classDef docs fill:#e2e3e5,stroke:#333,stroke-width:1px;
    classDef vcs fill:#f0f0f0,stroke:#333,stroke-width:1px;
    classDef external fill:#ffffff,stroke:#333,stroke-width:1px;

    subgraph "Developer Environment"
        Dev["Developer"]:::external
        VS[".vscode/"]:::vcs
    end

    GitHub["GitHub"]:::vcs

    Dev -->|"Contribute"| GitHub

    subgraph "Repository"
        GA[".gitattributes"]:::vcs
        BAS["1 Basics"]:::code
        ALG["2 Algorithims"]:::code
        ARR["3 Arrays"]:::code
        VEC["4 Vectors"]:::code
        STL["5 STL"]:::code
        SEA["6 Searching"]:::code
        SOR["7 Sorting"]:::code
        STR["8 String"]:::code
        BM["9 Basic Maths"]:::code
        REC["10 Recursion"]:::code
        BDG["11 BackTracking and DnC"]:::code
        LL["12 Linked Lists"]:::code
        STK["13 Stack"]:::code
        QUA["14 Queue"]:::code
        GBT["15 Generic Binary Tree"]:::code
        BST["16 Binary Search Tree"]:::code
        HEA["17 Heaps"]:::code
        TRI["18 Tries"]:::code
        DP["19 Dp"]:::code
        GR["20_graphs"]:::code
        BM2["21_Bit_Manipulation"]:::code
        LFG["100 leetcode and Gfg"]:::code
        CP["1000 Current"]:::code
        TEMP["tempCodeRunnerFile.cpp"]:::outputs
    end

    GitHub -->|"Clone/Pull"| Repository
    Repository -->|"Checkout"| IDE["IDE/Editor"]:::external
    IDE -->|"Compile"| Build["Build System (g++, Make/CMake)"]:::build

    subgraph "Module Outputs"
        BASOut["1 Basics/output/"]:::outputs
        VECOut["4 Vectors/output/"]:::outputs
        STL1["5 STL/1 Containers/output/"]:::outputs
        STL3["5 STL/3 Iterators/output/"]:::outputs
        BMOut["9 Basic Maths/output/"]:::outputs
        CPOut["1000 Current/output/"]:::outputs
    end

    Build -->|"Generate"| Exec["Executables"]:::outputs
    Build -->|"Place"| BASOut
    Build --> VECOut
    Build --> STL1
    Build --> STL3
    Build --> BMOut
    Build --> CPOut

    Exec -->|"Run/Test"| Console["Console Output"]:::outputs

    subgraph "Documentation"
        RMD["README.md"]:::docs
        Lic["LICENSE"]:::docs
    end
    Documentation --- Repository

    click VS "https://github.com/sachingoyal94/dsa/tree/main/.vscode/"
    click GA "https://github.com/sachingoyal94/dsa/blob/main/.gitattributes"
    click BAS "https://github.com/sachingoyal94/dsa/tree/main/1 Basics/"
    click ALG "https://github.com/sachingoyal94/dsa/tree/main/2 Algorithims/"
    click ARR "https://github.com/sachingoyal94/dsa/tree/main/3 Arrays/"
    click VEC "https://github.com/sachingoyal94/dsa/tree/main/4 Vectors/"
    click STL "https://github.com/sachingoyal94/dsa/tree/main/5 STL/"
    click SEA "https://github.com/sachingoyal94/dsa/tree/main/6 Searching/"
    click SOR "https://github.com/sachingoyal94/dsa/tree/main/7 Sorting/"
    click STR "https://github.com/sachingoyal94/dsa/tree/main/8 String/"
    click BM "https://github.com/sachingoyal94/dsa/tree/main/9 Basic Maths/"
    click REC "https://github.com/sachingoyal94/dsa/tree/main/10 Recursion/"
    click BDG "https://github.com/sachingoyal94/dsa/tree/main/11 BackTracking and DnC/"
    click LL "https://github.com/sachingoyal94/dsa/tree/main/12 Linked Lists/"
    click STK "https://github.com/sachingoyal94/dsa/tree/main/13 Stack/"
    click QUA "https://github.com/sachingoyal94/dsa/tree/main/14 Queue/"
    click GBT "https://github.com/sachingoyal94/dsa/tree/main/15 Generic Binary Tree/"
    click BST "https://github.com/sachingoyal94/dsa/tree/main/16 Binary Search Tree/"
    click HEA "https://github.com/sachingoyal94/dsa/tree/main/17 Heaps/"
    click TRI "https://github.com/sachingoyal94/dsa/tree/main/18 Tries/"
    click DP "https://github.com/sachingoyal94/dsa/tree/main/19 Dp/"
    click GR "https://github.com/sachingoyal94/dsa/tree/main/20_graphs/"
    click BM2 "https://github.com/sachingoyal94/dsa/tree/main/21_Bit_Manipulation/"
    click LFG "https://github.com/sachingoyal94/dsa/tree/main/100 leetcode and Gfg/"
    click CP "https://github.com/sachingoyal94/dsa/tree/main/1000 Current/"
    click TEMP "https://github.com/sachingoyal94/dsa/blob/main/tempCodeRunnerFile.cpp"
    click RMD "https://github.com/sachingoyal94/dsa/blob/main/README.md"
    click BASOut "https://github.com/sachingoyal94/dsa/tree/main/1 Basics/output/"
    click VECOut "https://github.com/sachingoyal94/dsa/tree/main/4 Vectors/output/"
    click STL1 "https://github.com/sachingoyal94/dsa/tree/main/5 STL/1 Containers/output/"
    click STL3 "https://github.com/sachingoyal94/dsa/tree/main/5 STL/3 Iterators/output/"
    click BMOut "https://github.com/sachingoyal94/dsa/tree/main/9 Basic Maths/output/"
    click CPOut "https://github.com/sachingoyal94/dsa/tree/main/1000 Current/output/"
```
