# mreric125/play-with-algorithms architecture

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

- Interactive diagram: https://gitdiagram.com/mreric125/play-with-algorithms
- Repository: https://github.com/mreric125/play-with-algorithms

## Overview

##### Project type and purpose
- This is an open-source, monolithic “course code” repository for an Algorithms & Data Structures class.
- It groups C++ and Java implementations of each lesson’s code examples, organized by chapter and sub-topics.

##### File structure
- Top-level directories:
- 02-Sorting-Basic
- 03-Sorting-Advance
- …
- 09-Shortest-Path
- src (static assets: qrcode.jpg, demo images)
- README.md, .gitignore
- Under each chapter folder:
- “Course Code (C++)” → modules like “01-Selection-Sort”, “02-Merge-Sort” … each with sources, headers, CMakeLists.txt
- “Course Code (Java)” → parallel package structure under src/bobo/algo
- Common helper files (SortTestHelper.h, UnionFindTestHelper.h, etc.) get reused across modules.

##### README for insights
- Confirms chapter/module breakdown, two language tracks, no external services or database.
- Emphasizes that this is purely source code for teaching, with build scripts for C++ (CMake) and standard Java project layouts.

##### Detail
- Every level (root → chapter → language → module → files).
- Build scripts’ scope and how they tie into C++ modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Root level
    Root["Repository Root"]:::root
    README["README.md"]:::doc
    Gitignore[".gitignore"]:::doc
    Root --> README
    Root --> Gitignore

    %% Static assets
    Assets["Static Assets (src/)"]:::assets
    Root --> Assets

    click README "https://github.com/mreric125/play-with-algorithms/blob/master/README.md"
    click Gitignore "https://github.com/mreric125/play-with-algorithms/blob/master/.gitignore"
    click Assets "https://github.com/mreric125/play-with-algorithms/tree/master/src/"

    %% Chapters grouping
    subgraph "Chapters"
        direction TB

        %% Chapter 02
        subgraph "02-Sorting-Basic/" 
            direction TB
            Chapter02["02-Sorting-Basic/"]:::chapter

            %% C++ subtree
            subgraph "C++ Code" 
                direction TB
                Cpp02Root["Course Code (C++)"]:::cplusplus
                CMake02Sel["CMakeLists.txt"]:::build
                Module02Sel["01-Selection-Sort"]:::cplusplus
                Cmk02Sel -->|builds| Module02Sel
                Module02Gen["03-Selection-Sort-Generate-Test-Cases"]:::cplusplus
                Module02Perf["04-Selection-Sort-Detect-Performance"]:::cplusplus
                Cpp02Root --> CMake02Sel
                Cpp02Root --> Module02Sel
                Cpp02Root --> Module02Gen
                Cpp02Root --> Module02Perf

                Module02Gen -.-> HelperSort["SortTestHelper.h"]:::helper
                Module02Perf -.-> HelperSort
            end

            %% Java subtree
            subgraph "Java Code"
                direction TB
                Java02Root["Course Code (Java)"]:::java
                JavaPkg02["src/bobo/algo/"]:::java
                SelSortJava["SelectionSort.java"]:::java
                SortHelperJava["SortTestHelper.java"]:::helper
                Java02Root --> JavaPkg02
                JavaPkg02 --> SelSortJava
                JavaPkg02 --> SortHelperJava
            end

            Chapter02 --> Cpp02Root
            Chapter02 --> Java02Root
        end

        %% Chapter 03
        subgraph "03-Sorting-Advance/" 
            direction TB
            Chapter03["03-Sorting-Advance/"]:::chapter

            subgraph "C++ Code"
                direction TB
                Cpp03Root["Course Code (C++)"]:::cplusplus
                CMake03Merge["CMakeLists.txt"]:::build
                Module03Merge["02-Merge-Sort"]:::cplusplus
                Cpp03Root --> CMake03Merge
                Cpp03Root --> Module03Merge
                Module03Merge -.-> HelperSort
            end

            subgraph "Java Code"
                direction TB
                Java03Root["Course Code (Java)"]:::java
                JavaPkg03["src/bobo/algo/"]:::java
                MergeSortJava["MergeSort.java"]:::java
                SortHelperJava03["SortTestHelper.java"]:::helper
                Java03Root --> JavaPkg03
                JavaPkg03 --> MergeSortJava
                JavaPkg03 --> SortHelperJava03
            end

            Chapter03 --> Cpp03Root
            Chapter03 --> Java03Root
        end

        %% Chapters 04-09 summary
        subgraph "04-Heap/" 
            direction TB
            Chapter04["04-Heap/"]:::chapter
        end
        subgraph "05-Binary-Search-Tree/" 
            direction TB
            Chapter05["05-Binary-Search-Tree/"]:::chapter
        end
        subgraph "06-Union-Find/" 
            direction TB
            Chapter06["06-Union-Find/"]:::chapter
        end
        subgraph "07-Graph-Basics/" 
            direction TB
            Chapter07["07-Graph-Basics/"]:::chapter
        end
        subgraph "08-Minimum-Span-Trees/" 
            direction TB
            Chapter08["08-Minimum-Span-Trees/"]:::chapter
        end
        subgraph "09-Shortest-Path/" 
            direction TB
            Chapter09["09-Shortest-Path/"]:::chapter
        end
    end

    Root --> Chapters

    %% Click events
    click CMake02Sel "https://github.com/mreric125/play-with-algorithms/blob/master/02-Sorting-Basic/Course Code (C++)/01-Selection-Sort/CMakeLists.txt"
    click CMake03Merge "https://github.com/mreric125/play-with-algorithms/blob/master/03-Sorting-Advance/Course Code (C++)/02-Merge-Sort/CMakeLists.txt"
    click Chapter02 "https://github.com/mreric125/play-with-algorithms/tree/master/02-Sorting-Basic/"
    click Chapter03 "https://github.com/mreric125/play-with-algorithms/tree/master/03-Sorting-Advance/"
    click Chapter04 "https://github.com/mreric125/play-with-algorithms/tree/master/04-Heap/"
    click Chapter05 "https://github.com/mreric125/play-with-algorithms/tree/master/05-Binary-Search-Tree/"
    click Chapter06 "https://github.com/mreric125/play-with-algorithms/tree/master/06-Union-Find/"
    click Chapter07 "https://github.com/mreric125/play-with-algorithms/tree/master/07-Graph-Basics/"
    click Chapter08 "https://github.com/mreric125/play-with-algorithms/tree/master/08-Minimum-Span-Trees/"
    click Chapter09 "https://github.com/mreric125/play-with-algorithms/tree/master/09-Shortest-Path/"

    %% Styles
    classDef root fill:#f9f,stroke:#333,stroke-width:1px
    classDef doc fill:#ff9,stroke:#333,stroke-width:1px
    classDef assets fill:#ccc,stroke:#333,stroke-width:1px
    classDef chapter fill:#eef,stroke:#333,stroke-width:1px
    classDef cplusplus fill:#ccf,stroke:#333,stroke-width:1px
    classDef java fill:#cfc,stroke:#333,stroke-width:1px
    classDef build fill:#fcf,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef helper fill:#ffc,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2
```
