# rachmantor/linknode-and-bubble-sort-2 architecture

> Architecture diagram of the GitHub repository rachmantor/linknode-and-bubble-sort-2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rachmantor/linknode-and-bubble-sort-2
- Repository: https://github.com/rachmantor/linknode-and-bubble-sort-2

## Overview

This is a small C++ command-line sorting demo backed by a custom singly linked list and bubble-sort implementations. The principal workflow prompts for integers and a sort mode, builds a list, optionally sorts it ascending or descending, then prints its values; other modes print the insertion order. The library also provides array-based bubble sort, though the shown CLI does not invoke it. Relationships shown are supported by the excerpts; no additional integrations are indicated.

Main entry points: [`main.cpp`](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/main.cpp) (Input and orchestration), [`LIB/Bsort/Bsort.cpp`](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/Bsort/Bsort.cpp) (List bubble sort), [`LIB/LinkNode/LinkNode.cpp`](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/LinkNode/LinkNode.cpp) (Linked list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line app"]
  node_cli["Input and orchestration<br/>[main.cpp]"]
  node_output["List display<br/>[main.cpp]"]
end

subgraph group_library["Sorting library"]
  node_list["Linked list<br/>[LinkNode.cpp]"]
  node_linked_sort["List bubble sort<br/>[Bsort.cpp]"]
  node_array_sort["Array bubble sort<br/>[Bsort.cpp]"]
end

node_user(("User"))

node_user -->|"enters values"| node_cli
node_user -->|"chooses mode"| node_cli
node_cli -->|"inserts and retrieves"| node_list
node_cli -->|"sorts list"| node_linked_sort
node_cli -->|"prints list"| node_output
node_linked_sort -->|"swaps values"| node_list

click node_cli "https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/main.cpp"
click node_list "https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/LinkNode/LinkNode.cpp"
click node_linked_sort "https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/Bsort/Bsort.cpp"
click node_array_sort "https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/Bsort/Bsort.cpp"
click node_output "https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/main.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_cli,node_output,node_user toneBlue
class node_list,node_linked_sort,node_array_sort toneAmber
```

## Components

### Command-line app

- [Input and orchestration](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/main.cpp): `main.cpp`
- [List display](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/main.cpp): `main.cpp`

### Sorting library

- [Linked list](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/LinkNode/LinkNode.cpp): `LIB/LinkNode/LinkNode.cpp`
- [List bubble sort](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/Bsort/Bsort.cpp): `LIB/Bsort/Bsort.cpp`
- [Array bubble sort](https://github.com/rachmantor/linknode-and-bubble-sort-2/blob/main/LIB/Bsort/Bsort.cpp): `LIB/Bsort/Bsort.cpp`

### Other components

- **User**

## Connections

- User → Input and orchestration: enters values (evidence: `main.cpp`)
- User → Input and orchestration: chooses mode (evidence: `main.cpp`)
- Input and orchestration → Linked list: inserts and retrieves (evidence: `main.cpp`)
- Input and orchestration → List bubble sort: sorts list (evidence: `main.cpp`)
- Input and orchestration → List display: prints list (evidence: `main.cpp`)
- List bubble sort → Linked list: swaps values (evidence: `LIB/Bsort/Bsort.cpp`)
