# jonathan-uy/cses-solutions architecture

> Architecture diagram of the GitHub repository jonathan-uy/cses-solutions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jonathan-uy/cses-solutions
- Repository: https://github.com/jonathan-uy/cses-solutions

## Overview

##### Main Components Organization

- Introductory Problems (Green)
- Sorting and Searching (Blue)
- Dynamic Programming (Purple)
- Graph Algorithms (Red)
- Range Queries (Orange)
- Tree Algorithms (Brown)
- Mathematics (Yellow)
- String Algorithms (Pink)
- Geometry (Cyan)
- Advanced Techniques (Gray)
- Additional Problems (Dark Blue)

##### Implementation Details

For each category, create a sub-component showing:
- Problem Types (represented as rounded rectangles)
- Solution Approaches (represented as hexagons)
- Common Algorithms Used (represented as ovals)

##### Technical Architecture Elements

Technical aspects:
- Language: C++ (central component)
- File Organization: Show the hierarchical structure
- Solution Pattern: Demonstrate the consistent implementation approach

##### Cross-Cutting Concerns

Overlays showing:
- Algorithm Complexity (O-notation)
- Memory Usage Patterns
- Common Code Patterns
- Testing/Verification Methods

##### Top Section
**[C++ Implementation Layer]**
- ↓
**[Problem Categories Layer]**
- ↓
**[Solution Patterns Layer]**

##### Category Interconnections
**Graph Algorithms ←→ Tree Algorithms**
- ↓
**Dynamic Programming**
- ↓
**Range Queries**

##### Implementation Pattern
**[Problem Input] → [Algorithm Implementation] → [Output Generation]**

Use these symbols:
- □ for main categories
- ○ for algorithms
- ◇ for solution patterns
- → for direct relationships
- ⟷ for bidirectional relationships

Important Considerations:

##### Documentation
- Brief descriptions for each component
- Special relationships or dependencies

- The organizational structure of the solutions
- The relationships between different problem types
- The implementation patterns used across solutions
- The progression path from basic to advanced problems

Remember to maintain clarity while showing the complexity of the relationships between different problem categories and their solutions.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Completed Problem]:::completed
        L2[Pending Problem]:::pending
        L3[Category]:::category
        L4[("Statistics<br/>✓ Complete")]:::stats
    end

    Root[("CSES Problem Set<br/>288/300 Complete")]:::stats
    PC[Problem Categories]:::category

    Root --> PC
    PC --> IP[Introductory Problems]:::category
    IP --> WA[Weird Algorithm]:::completed
    WA --> WD[Weird Algorithm Details:<br/>- Collatz conjecture<br/>- Number sequence<br/>- Basic implementation]:::completed

    PC --> SS[Sorting and Searching]:::category
    SS --> SA[Sorting Approaches:<br/>- Quick Sort<br/>- Merge Sort<br/>- Binary Search]:::category

    PC --> DP[Dynamic Programming]:::category
    DP --> DC[Dice Combinations]:::completed
    DC --> DD[Dice Details:<br/>- Sum combinations<br/>- Modular arithmetic<br/>- State transitions]:::completed
    DP --> AD[Array Description]:::completed
    DP --> CC1[Coin Combinations I]:::completed
    DP --> CC2[Coin Combinations II]:::completed

    PC --> GA[Graph Algorithms]:::category
    GA --> CR[Counting Rooms]:::completed
    CR --> CRD[Room Analysis:<br/>- Connected components<br/>- DFS/BFS<br/>- Grid traversal]:::completed
    GA --> BR[Building Roads]:::completed
    GA --> SR[Shortest Routes I]:::completed
    GA --> FR[Flight Routes]:::completed

    PC --> RQ[Range Queries]:::category
    RQ --> RQD[Query Types:<br/>- Segment Trees<br/>- Fenwick Trees<br/>- Sparse Tables]:::category

    PC --> TA[Tree Algorithms]:::category
    TA --> TD[Tree Diameter]:::completed
    TA --> TDI[Tree Distances I]:::completed
    TA --> TM[Tree Matching]:::completed

    PC --> MA[Mathematics]:::category
    MA --> MD[Math Concepts:<br/>- Number Theory<br/>- Combinatorics<br/>- Probability]:::category

    PC --> SA2[String Algorithms]:::category
    SA2 --> SM[String Matching]:::completed

    PC --> GE[Geometry]:::category
    GE --> GD[Geometric Concepts:<br/>- Points & Lines<br/>- Polygons<br/>- Vectors]:::category

    PC --> AT[Advanced Techniques]:::category
    AT --> MM[Meet in the Middle]:::completed
    AT --> HD[Hamming Distance]:::completed
    AT --> BS[Beautiful Subgrids]:::completed

    PC --> AP[Additional Problems]:::category

    %% Preserve all original click events
    click IP "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Introductory Problems"
    click SS "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Sorting and Searching"
    click DP "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Dynamic Programming"
    click GA "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Graph Algorithms"
    click RQ "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Range Queries"
    click TA "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Tree Algorithms"
    click MA "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Mathematics"
    click SA2 "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/String Algorithms"
    click GE "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Geometry"
    click AT "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Advanced Techniques"
    click AP "https://github.com/Jonathan-Uy/CSES-Solutions/tree/main/Additional Problems"
    
    click WA "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Introductory Problems/Weird Algorithm.cpp"
    click DC "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Dynamic Programming/Dice Combinations.cpp"
    click CR "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Graph Algorithms/Counting Rooms.cpp"
    click SM "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/String Algorithms/String Matching.cpp"
    click BR "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Graph Algorithms/Building Roads.cpp"
    click SR "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Graph Algorithms/Shortest Routes I.cpp"
    click FR "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Graph Algorithms/Flight Routes.cpp"
    click AD "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Dynamic Programming/Array Description.cpp"
    click CC1 "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Dynamic Programming/Coin Combinations I.cpp"
    click CC2 "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Dynamic Programming/Coin Combinations II.cpp"
    click TD "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Tree Algorithms/Tree Diameter.cpp"
    click TDI "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Tree Algorithms/Tree Distances I.cpp"
    click TM "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Tree Algorithms/Tree Matching.cpp"
    click MM "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Advanced Techniques/Meet in the Middle.cpp"
    click HD "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Advanced Techniques/Hamming Distance.cpp"
    click BS "https://github.com/Jonathan-Uy/CSES-Solutions/blob/main/Advanced Techniques/Beautiful Subgrids.cpp"

    classDef category fill:#3498db,stroke:#2980b9,color:white
    classDef completed fill:#2ecc71,stroke:#27ae60,color:white
    classDef pending fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef stats fill:#e74c3c,stroke:#c0392b,color:white
```
