# qqwst/lllr2 architecture

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

- Interactive diagram: https://gitdiagram.com/qqwst/lllr2
- Repository: https://github.com/qqwst/lllr2

## Overview

This repository is a collection of independent C++ lab programs, not one integrated application. Users run separate command-line exercises: stack operations, a persistent set, a turtle-statement counter, a character histogram, Huffman encoding/decoding, Roman-numeral conversion using a hash table, and an LFU cache. The graph shows the documented and indexed call relationships; unsampled implementations are represented only at their supported directory paths, with no inferred links between exercises.

Main entry points: [`5.Huffman/main.cpp`](https://github.com/qqwst/lllr2/blob/main/5.Huffman/main.cpp) (Encoding workflow), [`2. Set/main.cpp`](https://github.com/qqwst/lllr2/blob/main/2.%20Set/main.cpp) (Set command loop), [`5.Huffman/Huffman.cpp`](https://github.com/qqwst/lllr2/blob/main/5.Huffman/Huffman.cpp) (Huffman operations), [`2. Set/set.cpp`](https://github.com/qqwst/lllr2/blob/main/2.%20Set/set.cpp) (Hash-bucket set)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_containers["Data structures"]
  node_stack_logic["Stack operations<br/>[logic.cpp]"]
  node_stack["Stack structure<br/>[stack.cpp]"]
  node_set_storage["Set persistence<br/>[file.cpp]"]
  node_set["Hash-bucket set<br/>[set.cpp]"]
  node_array["Dynamic array and counts<br/>[array.cpp]"]
  node_hash_table["Chained and cuckoo tables<br/>[hash_table.cpp]"]
  node_lfu_cache["LFU cache<br/>[lfu.cpp]"]
end

subgraph group_exercises["Lab programs"]
  node_stack_app["Stack exercise<br/>[main.cpp]"]
  node_set_app["Set command loop<br/>[main.cpp]"]
  node_turtle_app["Turtle counter<br/>[main.cpp]"]
  node_histogram_app["Histogram exercise<br/>[main.cpp]"]
  node_roman_app["Roman numeral converter<br/>[main.cpp]"]
  node_lfu_app["LFU request loop<br/>[main.cpp]"]
end

subgraph group_huffman["Huffman coding"]
  node_huffman_app["Encoding workflow<br/>[main.cpp]"]
  node_huffman["Huffman operations<br/>[Huffman.cpp]"]
  node_tree["Huffman tree<br/>[tree.cpp]"]
  node_code_list["Code table list<br/>[flist.cpp]"]
end

node_user(("Command-line user"))

node_user -->|"runs"| node_stack_app
node_user -->|"runs"| node_set_app
node_user -->|"runs"| node_turtle_app
node_user -->|"runs"| node_histogram_app
node_user -->|"runs"| node_huffman_app
node_user -->|"runs"| node_roman_app
node_user -->|"runs"| node_lfu_app
node_stack_app -->|"calls"| node_stack_logic
node_stack_logic -->|"uses"| node_stack
node_set_app -->|"loads and saves"| node_set_storage
node_set_app -->|"calls"| node_set
node_set_storage -->|"uses"| node_set
node_turtle_app -->|"checks and updates"| node_set
node_histogram_app -->|"uses"| node_array
node_huffman_app -->|"encodes and decodes"| node_huffman
node_huffman_app -->|"builds and deletes"| node_tree
node_huffman_app -->|"creates and frees"| node_code_list
node_huffman -->|"builds and traverses"| node_tree
node_huffman -->|"uses code table"| node_code_list
node_roman_app -->|"stores and searches"| node_hash_table
node_lfu_app -->|"gets and sets"| node_lfu_cache

click node_stack_app "https://github.com/qqwst/lllr2/blob/main/1.%20Stack/main.cpp"
click node_stack_logic "https://github.com/qqwst/lllr2/blob/main/1.%20Stack/logic.cpp"
click node_stack "https://github.com/qqwst/lllr2/blob/main/1.%20Stack/stack.cpp"
click node_set_app "https://github.com/qqwst/lllr2/blob/main/2.%20Set/main.cpp"
click node_set_storage "https://github.com/qqwst/lllr2/blob/main/2.%20Set/file.cpp"
click node_set "https://github.com/qqwst/lllr2/blob/main/2.%20Set/set.cpp"
click node_turtle_app "https://github.com/qqwst/lllr2/blob/main/3.%20Turtle/main.cpp"
click node_histogram_app "https://github.com/qqwst/lllr2/blob/main/4.Gistgramm/main.cpp"
click node_array "https://github.com/qqwst/lllr2/blob/main/4.Gistgramm/array.cpp"
click node_huffman_app "https://github.com/qqwst/lllr2/blob/main/5.Huffman/main.cpp"
click node_huffman "https://github.com/qqwst/lllr2/blob/main/5.Huffman/Huffman.cpp"
click node_tree "https://github.com/qqwst/lllr2/blob/main/5.Huffman/structs/tree.cpp"
click node_code_list "https://github.com/qqwst/lllr2/blob/main/5.Huffman/structs/flist.cpp"
click node_roman_app "https://github.com/qqwst/lllr2/blob/main/6.HashT/main.cpp"
click node_hash_table "https://github.com/qqwst/lllr2/blob/main/6.HashT/hash_table.cpp"
click node_lfu_app "https://github.com/qqwst/lllr2/blob/main/7.LFU/main.cpp"
click node_lfu_cache "https://github.com/qqwst/lllr2/blob/main/7.LFU/lfu.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_stack_logic,node_stack,node_set_storage,node_set,node_array,node_hash_table,node_lfu_cache,node_user toneBlue
class node_stack_app,node_set_app,node_turtle_app,node_histogram_app,node_roman_app,node_lfu_app toneAmber
class node_huffman_app,node_huffman,node_tree,node_code_list toneMint
```

## Components

### Data structures

- [Stack operations](https://github.com/qqwst/lllr2/blob/main/1.%20Stack/logic.cpp): `1. Stack/logic.cpp`
- [Stack structure](https://github.com/qqwst/lllr2/blob/main/1.%20Stack/stack.cpp): `1. Stack/stack.cpp`
- [Set persistence](https://github.com/qqwst/lllr2/blob/main/2.%20Set/file.cpp): `2. Set/file.cpp`
- [Hash-bucket set](https://github.com/qqwst/lllr2/blob/main/2.%20Set/set.cpp): `2. Set/set.cpp`
- [Dynamic array and counts](https://github.com/qqwst/lllr2/blob/main/4.Gistgramm/array.cpp): `4.Gistgramm/array.cpp`
- [Chained and cuckoo tables](https://github.com/qqwst/lllr2/blob/main/6.HashT/hash_table.cpp): `6.HashT/hash_table.cpp`
- [LFU cache](https://github.com/qqwst/lllr2/blob/main/7.LFU/lfu.cpp): `7.LFU/lfu.cpp`

### Lab programs

- [Stack exercise](https://github.com/qqwst/lllr2/blob/main/1.%20Stack/main.cpp): `1. Stack/main.cpp`
- [Set command loop](https://github.com/qqwst/lllr2/blob/main/2.%20Set/main.cpp): `2. Set/main.cpp`
- [Turtle counter](https://github.com/qqwst/lllr2/blob/main/3.%20Turtle/main.cpp): `3. Turtle/main.cpp`
- [Histogram exercise](https://github.com/qqwst/lllr2/blob/main/4.Gistgramm/main.cpp): `4.Gistgramm/main.cpp`
- [Roman numeral converter](https://github.com/qqwst/lllr2/blob/main/6.HashT/main.cpp): `6.HashT/main.cpp`
- [LFU request loop](https://github.com/qqwst/lllr2/blob/main/7.LFU/main.cpp): `7.LFU/main.cpp`

### Huffman coding

- [Encoding workflow](https://github.com/qqwst/lllr2/blob/main/5.Huffman/main.cpp): `5.Huffman/main.cpp`
- [Huffman operations](https://github.com/qqwst/lllr2/blob/main/5.Huffman/Huffman.cpp): `5.Huffman/Huffman.cpp`
- [Huffman tree](https://github.com/qqwst/lllr2/blob/main/5.Huffman/structs/tree.cpp): `5.Huffman/structs/tree.cpp`
- [Code table list](https://github.com/qqwst/lllr2/blob/main/5.Huffman/structs/flist.cpp): `5.Huffman/structs/flist.cpp`

### Other components

- **Command-line user**

## Connections

- Command-line user → Stack exercise: runs
- Command-line user → Set command loop: runs
- Command-line user → Turtle counter: runs
- Command-line user → Histogram exercise: runs
- Command-line user → Encoding workflow: runs
- Command-line user → Roman numeral converter: runs
- Command-line user → LFU request loop: runs
- Stack exercise → Stack operations: calls (evidence: `1. Stack/main.cpp`)
- Stack operations → Stack structure: uses
- Set command loop → Set persistence: loads and saves (evidence: `2. Set/main.cpp`)
- Set command loop → Hash-bucket set: calls (evidence: `2. Set/main.cpp`)
- Set persistence → Hash-bucket set: uses
- Turtle counter → Hash-bucket set: checks and updates (evidence: `3. Turtle/main.cpp`)
- Histogram exercise → Dynamic array and counts: uses (evidence: `4.Gistgramm/main.cpp`)
- Encoding workflow → Huffman operations: encodes and decodes (evidence: `5.Huffman/main.cpp`)
- Encoding workflow → Huffman tree: builds and deletes (evidence: `5.Huffman/main.cpp`)
- Encoding workflow → Code table list: creates and frees (evidence: `5.Huffman/main.cpp`)
- Huffman operations → Huffman tree: builds and traverses
- Huffman operations → Code table list: uses code table
- Roman numeral converter → Chained and cuckoo tables: stores and searches (evidence: `6.HashT/main.cpp`)
- LFU request loop → LFU cache: gets and sets (evidence: `7.LFU/main.cpp`)
