# lucasgabriel-cp/competitive_prog architecture

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

- Interactive diagram: https://gitdiagram.com/lucasgabriel-cp/competitive_prog
- Repository: https://github.com/lucasgabriel-cp/competitive_prog

## Overview

##### Main Components
- Codes Library: This is the core component and includes subdirectories for various algorithm categories such as Data Structures (e.g., Binary Search Trees, Segment Trees), Geometry, Graph Algorithms, Mathematics algorithms, Paradigms, and String processing. Each subdirectory encapsulates implementations that are reusable in competitive programming challenges.
- Solutions: This part of the repository is organized by problem source – indicated by directories like Beecrowd (URI), SPOJ, UVA, misc, etc. It contains individual solutions to competitive programming problems, leveraging the algorithms and data structures implemented in the Codes library.
- Ancillary Files: Other files such as the makefile and template.cpp serve as build scripts or starting templates for new solution files.

##### Architectural Patterns and Design Principles
- Modularity: Each folder within Codes represents a self-contained module (e.g., Graph, Data Structures) that is designed for reusability.
- Separation of Concerns: The project is clearly divided between general-purpose algorithms and problem-solving implementations. This separation improves maintainability and allows isolated testing and extension.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Competitive Programming Repository"
        %% Codes Library Subgraph
        subgraph "Codes Library"
            CL_Core("Codes Library Core"):::libraryCore
            DS("Data Structures"):::library
            GE("Geometry"):::library
            GR("Graph Algorithms"):::library
            MA("Mathematics"):::library
            PA("Paradigms"):::library
            ST("String Processing"):::library
            CL_Core --> DS
            CL_Core --> GE
            CL_Core --> GR
            CL_Core --> MA
            CL_Core --> PA
            CL_Core --> ST
        end

        %% Solutions Repository Subgraph
        subgraph "Solutions Repository"
            SOL_Core("Solutions Core"):::solutionCore
            BC("Beecrowd (URI)"):::solution
            SJ("SPOJ"):::solution
            UV("UVA"):::solution
            MI("Miscellaneous"):::solution
            SOL_Core --> BC
            SOL_Core --> SJ
            SOL_Core --> UV
            SOL_Core --> MI
        end

        %% Ancillary Files Subgraph
        subgraph "Ancillary Files"
            MF("makefile"):::ancillary
            TC("template.cpp"):::ancillary
            RD("README.md"):::ancillary
        end
    end

    %% Relationship: Codes Library is used by Solutions Repository
    CL_Core -->|"uses"| SOL_Core

    %% Ancillary Files connect to both Codes Library and Solutions Repository
    MF --- CL_Core
    MF --- SOL_Core
    TC --- CL_Core
    TC --- SOL_Core
    RD --- CL_Core
    RD --- SOL_Core

    %% Click Events
    click CL_Core "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Codes"
    click DS "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Codes/Data_Struct"
    click GE "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Codes/Geometry"
    click GR "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Codes/Graph"
    click MA "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Codes/Math"
    click PA "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Codes/Paradigms"
    click ST "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Codes/String"
    click SOL_Core "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Solutions"
    click BC "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Solutions/Beecrowd(URI)"
    click SJ "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Solutions/SPOJ"
    click UV "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Solutions/UVA"
    click MI "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/Solutions/misc"
    click MF "https://github.com/lucasgabriel-cp/competitive_prog/tree/main/makefile"
    click TC "https://github.com/lucasgabriel-cp/competitive_prog/blob/main/template.cpp"
    click RD "https://github.com/lucasgabriel-cp/competitive_prog/blob/main/README.md"

    %% Styles
    classDef libraryCore fill:#AED6F1,stroke:#2E86C1,stroke-width:2px;
    classDef library fill:#D6EAF8,stroke:#2980B9,stroke-width:2px;
    classDef solutionCore fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef solution fill:#FCF3CF,stroke:#F39C12,stroke-width:2px;
    classDef ancillary fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
```
