# roslindesiredziele-hash/algorithms-sorting-benchmark architecture

> Architecture diagram of the GitHub repository roslindesiredziele-hash/algorithms-sorting-benchmark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/roslindesiredziele-hash/algorithms-sorting-benchmark
- Repository: https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark

## Overview

This is a sorting-algorithm benchmark: the runner generates random inputs, times six sorts over repeated runs, checks sortedness, averages timings, and writes CSV results; a separate script turns that CSV into comparison charts. The custom Vec is the shared in-memory data structure. The README documents these capabilities, and the excerpts show the runner, sort implementations, Vec, and plotting script. The chart and CSV flows are explicit; no separate runtime service or database is involved.

Main entry points: [`src/main.cpp`](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/main.cpp) (Benchmark Runner), [`src/Vec.cpp`](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/Vec.cpp) (Dynamic Vec), [`src/sorts.cpp`](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp) (Bubble Sort), [`data/data.csv`](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/data/data.csv) (Benchmark CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_benchmark["Benchmarking"]
  node_runner["Benchmark Runner<br/>[main.cpp]"]
  node_input["Random Inputs<br/>[main.cpp]"]
end

subgraph group_sorting["Sorting"]
  node_bubble["Bubble Sort<br/>[sorts.cpp]"]
  node_insertion["Insertion Sort<br/>[sorts.cpp]"]
  node_merge["Merge Sort<br/>[sorts.cpp]"]
  node_quick["Quick Sort<br/>[sorts.cpp]"]
  node_heap["Heap Sort<br/>[sorts.cpp]"]
  node_shell["Shell Sort<br/>[sorts.cpp]"]
  node_verification["Sortedness Check<br/>[sorts.cpp]"]
end

subgraph group_structure["Data Structure"]
  node_vec["Dynamic Vec<br/>[Vec.cpp]"]
end

subgraph group_analysis["Results Analysis"]
  node_csv["Benchmark CSV<br/>[data.csv]"]
  node_charts["Comparison Charts<br/>[plot_results.py]"]
end

node_user(("User"))

node_user -->|"runs benchmark"| node_runner
node_runner -->|"generates"| node_input
node_runner -->|"times"| node_bubble
node_runner -->|"times"| node_insertion
node_runner -->|"times"| node_merge
node_runner -->|"times"| node_quick
node_runner -->|"times"| node_heap
node_runner -->|"times"| node_shell
node_runner -->|"checks results"| node_verification
node_runner -->|"writes averages"| node_csv
node_charts -->|"reads results"| node_csv
node_runner -->|"uses"| node_vec
node_bubble -->|"sorts"| node_vec
node_insertion -->|"sorts"| node_vec
node_merge -->|"sorts"| node_vec
node_quick -->|"sorts"| node_vec
node_heap -->|"sorts"| node_vec
node_shell -->|"sorts"| node_vec

click node_runner "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/main.cpp"
click node_input "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/main.cpp"
click node_csv "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/data/data.csv"
click node_charts "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/data/plot_results.py"
click node_bubble "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp"
click node_insertion "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp"
click node_merge "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp"
click node_quick "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp"
click node_heap "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp"
click node_shell "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp"
click node_verification "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp"
click node_vec "https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/Vec.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_input,node_user toneBlue
class node_bubble,node_insertion,node_merge,node_quick,node_heap,node_shell,node_verification toneAmber
class node_vec toneMint
class node_csv,node_charts toneRose
```

## Components

### Benchmarking

- [Benchmark Runner](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/main.cpp): `src/main.cpp`
- [Random Inputs](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/main.cpp): `src/main.cpp`

### Sorting

- [Bubble Sort](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp): `src/sorts.cpp`
- [Insertion Sort](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp): `src/sorts.cpp`
- [Merge Sort](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp): `src/sorts.cpp`
- [Quick Sort](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp): `src/sorts.cpp`
- [Heap Sort](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp): `src/sorts.cpp`
- [Shell Sort](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp): `src/sorts.cpp`
- [Sortedness Check](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/sorts.cpp): `src/sorts.cpp`

### Data Structure

- [Dynamic Vec](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/src/Vec.cpp): `src/Vec.cpp`

### Results Analysis

- [Benchmark CSV](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/data/data.csv): `data/data.csv`
- [Comparison Charts](https://github.com/roslindesiredziele-hash/algorithms-sorting-benchmark/blob/master/data/plot_results.py): `data/plot_results.py`

### Other components

- **User**

## Connections

- User → Benchmark Runner: runs benchmark (evidence: `README.md`)
- Benchmark Runner → Random Inputs: generates (evidence: `src/main.cpp`)
- Benchmark Runner → Bubble Sort: times (evidence: `src/main.cpp`)
- Benchmark Runner → Insertion Sort: times (evidence: `src/main.cpp`)
- Benchmark Runner → Merge Sort: times (evidence: `src/main.cpp`)
- Benchmark Runner → Quick Sort: times (evidence: `src/main.cpp`)
- Benchmark Runner → Heap Sort: times (evidence: `src/main.cpp`)
- Benchmark Runner → Shell Sort: times (evidence: `src/main.cpp`)
- Benchmark Runner → Sortedness Check: checks results (evidence: `src/main.cpp`)
- Benchmark Runner → Benchmark CSV: writes averages (evidence: `src/main.cpp`)
- Comparison Charts → Benchmark CSV: reads results (evidence: `data/plot_results.py`)
- Benchmark Runner → Dynamic Vec: uses (evidence: `src/main.cpp`)
- Bubble Sort → Dynamic Vec: sorts (evidence: `src/sorts.cpp`)
- Insertion Sort → Dynamic Vec: sorts (evidence: `src/sorts.cpp`)
- Merge Sort → Dynamic Vec: sorts (evidence: `src/sorts.cpp`)
- Quick Sort → Dynamic Vec: sorts (evidence: `src/sorts.cpp`)
- Heap Sort → Dynamic Vec: sorts (evidence: `src/sorts.cpp`)
- Shell Sort → Dynamic Vec: sorts (evidence: `src/sorts.cpp`)
