# wowperro/datastructures-algorithms-w-templates-c- architecture

> Architecture diagram of the GitHub repository wowperro/datastructures-algorithms-w-templates-c-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wowperro/datastructures-algorithms-w-templates-c-
- Repository: https://github.com/wowperro/datastructures-algorithms-w-templates-c-

## Overview

##### Project Type and Purpose
- The project is an educational library/tool with multiple implementations of fundamental data structures and algorithms.
- It focuses on examples from a C++ object-oriented programming class including templates, providing implementations of a graph (Grafo), simple and sorted lists (ListaS and ListaT), trees (AVL tree as TreeB and binary search tree as TreeT), and their associated nodes (NodoA for trees, NodoG for graphs), in addition to Queue and Stack implementations.

##### File Structure
- There is a Visual Studio solution (C4_NodoT.sln) that contains a single project folder (C4_NodoT). This folder includes C++ source files (.cpp) and headers (.h) for each data structure component.
- The structure is flat: each component (e.g., Grafo, ListaS, TreeB) has its own pair of source and header files, which indicates a modular design where each concept is encapsulated.

##### Main Architectural Components
- Data Structure Components:
- Graph: Represented by Grafo.cpp and Grafo.h.
- Lists:
> ListaS for a simple list.
> ListaT for a list with implemented sorting algorithms.
- Trees:
> TreeB as an AVL tree.
> TreeT as a binary search tree.
> Associated node classes: NodoA for tree nodes and NodoG for graph nodes.
- Queue and Stack:
> Queue implementation.
> StackT implementation.
- Template Usage:

##### Relationships and Interactions
- Make it clear that the nodes (NodoA, NodoG) serve as the building blocks for their respective higher-level structures (trees and graphs).

##### Architectural Patterns
- That the design follows modular and reusable template-based programming principles.
- That each data structure is self-contained and can be independently tested or extended—this modular separation is an architectural design principle for educational and maintenance purposes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    TPL["Templates"]:::template

    subgraph "Trees"
        TreeB["TreeB: AVL tree (self-balancing)"]:::treeComp
        TreeT["TreeT: Binary Search Tree"]:::treeComp
        NodoA["NodoA: Tree Node"]:::treeNode
        TreeB -->|"composes"| NodoA
        TreeT -->|"composes"| NodoA
    end

    subgraph "Graph"
        Grafo["Grafo: Graph Implementation"]:::graphComp
        NodoG["NodoG: Graph Node"]:::graphNode
        Grafo -->|"composes"| NodoG
    end

    subgraph "Linear Structures"
        ListaS["ListaS: Simple List"]:::linearComp
        ListaT["ListaT: Sorted List (with sorting algorithms)"]:::linearComp
        Queue["Queue: Queue Implementation"]:::linearComp
        StackT["StackT: Stack Implementation"]:::linearComp
    end

    TPL ---|"templates"| Grafo
    TPL ---|"templates"| ListaS
    TPL ---|"templates"| ListaT
    TPL ---|"templates"| TreeB
    TPL ---|"templates"| TreeT
    TPL ---|"templates"| Queue
    TPL ---|"templates"| StackT

    %% Click Events for Component Mapping
    click Grafo "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/Grafo.cpp"
    click Grafo "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/Grafo.h"
    click ListaS "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/ListaS.cpp"
    click ListaS "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/ListaS.h"
    click ListaT "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/ListaT.cpp"
    click ListaT "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/ListaT.h"
    click TreeB "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/TreeB.cpp"
    click TreeB "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/TreeB.h"
    click TreeT "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/TreeT.cpp"
    click TreeT "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/TreeT.h"
    click NodoA "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/NodoA.cpp"
    click NodoA "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/NodoA.h"
    click NodoG "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/NodoG.cpp"
    click NodoG "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/NodoG.h"
    click Queue "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/Queue.cpp"
    click Queue "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/Queue.h"
    click StackT "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/StackT.cpp"
    click StackT "https://github.com/wowperro/datastructures-algorithms-w-templates-c-/blob/master/C4_NodoT/StackT.h"

    %% Styles
    classDef template fill:#f2f2f2,stroke:#333,stroke-width:2px,font-family:monospace;
    classDef treeComp fill:#ccffcc,stroke:#333,stroke-width:2px,font-family:monospace;
    classDef treeNode fill:#e6ffe6,stroke:#333,stroke-width:2px,font-family:monospace;
    classDef graphComp fill:#ccf2ff,stroke:#333,stroke-width:2px,font-family:monospace;
    classDef graphNode fill:#e6f7ff,stroke:#333,stroke-width:2px,font-family:monospace;
    classDef linearComp fill:#ffe6cc,stroke:#333,stroke-width:2px,font-family:monospace;
```
