# alxshenn/third-lab2 architecture

> Architecture diagram of the GitHub repository alxshenn/third-lab2, 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/alxshenn/third-lab2
- Repository: https://github.com/alxshenn/third-lab2

## Overview

This repository is a set of C++ data-structure exercises, not one integrated application. Its user-facing workflows are separate command-line programs: manage persistent hash sets, evaluate postfix expressions, operate an LFU cache, compare string-isomorphism methods, and exercise Huffman coding and arrays. The structures directory supplies the implementations used by those tasks; hash-set persistence uses a text file. The README is empty, so capabilities and relationships here are based on the source index and shown excerpts; taskTurtle’s behavior is not sampled.

Main entry points: [`structures/storage.cpp`](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/storage.cpp) (Set persistence), [`structures/hashSet.cpp`](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/hashSet.cpp) (Hash set), [`taskHashSet.cpp`](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHashSet.cpp) (Hash-set manager), [`taskHashTable.cpp`](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHashTable.cpp) (Isomorphism comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tasks["Command-line tasks"]
  node_hashset_task["Hash-set manager<br/>[taskHashSet.cpp]"]
  node_isomorphism_task["Isomorphism comparison<br/>[taskHashTable.cpp]"]
  node_huffman_task["Huffman task<br/>[taskHuffman.cpp]"]
  node_histogram_task["Histogram task<br/>[taskHystogramm.cpp]"]
  node_lfu_task["LFU manager<br/>[taskLFU.cpp]"]
  node_stack_task["Postfix evaluator<br/>[taskStack.cpp]"]
  node_turtle_task["Turtle task<br/>[taskTurtle.cpp]"]
end

subgraph group_hash["Hash sets"]
  node_hashset["Hash set<br/>[hashSet.cpp]"]
  node_cuckoo["Cuckoo hash table<br/>[cuckooHash.cpp]"]
  node_storage["Set persistence<br/>[storage.cpp]"]
end

subgraph group_compression["Huffman coding"]
  node_huffman["Huffman coder<br/>[huffmanTree.cpp]"]
  node_array["Dynamic array<br/>[array.cpp]"]
end

subgraph group_other["Other structures"]
  node_lfu["LFU cache<br/>[lfuCache.cpp]"]
  node_stack["Stack<br/>[stack.cpp]"]
end

node_data_file[("Set data file<br/>[data.txt]")]

node_hashset_task -->|"loads and saves"| node_storage
node_hashset_task -->|"manipulates sets"| node_hashset
node_storage -->|"reads and writes"| node_hashset
node_storage -->|"reads and writes"| node_data_file
node_isomorphism_task -->|"checks mappings"| node_hashset
node_isomorphism_task -->|"checks mappings"| node_cuckoo
node_huffman_task -->|"uses coder"| node_huffman
node_huffman -->|"stores codes"| node_array
node_histogram_task -->|"uses array"| node_array
node_lfu_task -->|"gets and puts"| node_lfu
node_stack_task -->|"evaluates with"| node_stack

click node_hashset_task "https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHashSet.cpp"
click node_isomorphism_task "https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHashTable.cpp"
click node_huffman_task "https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHuffman.cpp"
click node_histogram_task "https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHystogramm.cpp"
click node_lfu_task "https://github.com/alxshenn/third-lab2/blob/third-lab2/taskLFU.cpp"
click node_stack_task "https://github.com/alxshenn/third-lab2/blob/third-lab2/taskStack.cpp"
click node_turtle_task "https://github.com/alxshenn/third-lab2/blob/third-lab2/taskTurtle.cpp"
click node_hashset "https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/hashSet.cpp"
click node_cuckoo "https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/cuckooHash.cpp"
click node_storage "https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/storage.cpp"
click node_data_file "https://github.com/alxshenn/third-lab2/blob/third-lab2/data.txt"
click node_huffman "https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/huffmanTree.cpp"
click node_array "https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/array.cpp"
click node_lfu "https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/lfuCache.cpp"
click node_stack "https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/stack.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_hashset_task,node_isomorphism_task,node_huffman_task,node_histogram_task,node_lfu_task,node_stack_task,node_turtle_task toneBlue
class node_hashset,node_cuckoo,node_storage,node_data_file toneAmber
class node_huffman,node_array toneMint
class node_lfu,node_stack toneRose
```

## Components

### Command-line tasks

- [Hash-set manager](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHashSet.cpp): `taskHashSet.cpp`
- [Isomorphism comparison](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHashTable.cpp): `taskHashTable.cpp`
- [Huffman task](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHuffman.cpp): `taskHuffman.cpp`
- [Histogram task](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskHystogramm.cpp): `taskHystogramm.cpp`
- [LFU manager](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskLFU.cpp): `taskLFU.cpp`
- [Postfix evaluator](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskStack.cpp): `taskStack.cpp`
- [Turtle task](https://github.com/alxshenn/third-lab2/blob/third-lab2/taskTurtle.cpp): `taskTurtle.cpp`

### Hash sets

- [Hash set](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/hashSet.cpp): `structures/hashSet.cpp`
- [Cuckoo hash table](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/cuckooHash.cpp): `structures/cuckooHash.cpp`
- [Set persistence](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/storage.cpp): `structures/storage.cpp`

### Huffman coding

- [Huffman coder](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/huffmanTree.cpp): `structures/huffmanTree.cpp`
- [Dynamic array](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/array.cpp): `structures/array.cpp`

### Other structures

- [LFU cache](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/lfuCache.cpp): `structures/lfuCache.cpp`
- [Stack](https://github.com/alxshenn/third-lab2/blob/third-lab2/structures/stack.cpp): `structures/stack.cpp`

### Other components

- [Set data file](https://github.com/alxshenn/third-lab2/blob/third-lab2/data.txt): `data.txt`

## Connections

- Hash-set manager → Set persistence: loads and saves (evidence: `taskHashSet.cpp`)
- Hash-set manager → Hash set: manipulates sets (evidence: `taskHashSet.cpp`)
- Set persistence → Hash set: reads and writes (evidence: `structures/storage.cpp`)
- Set persistence → Set data file: reads and writes (evidence: `structures/storage.cpp`)
- Isomorphism comparison → Hash set: checks mappings (evidence: `taskHashTable.cpp`)
- Isomorphism comparison → Cuckoo hash table: checks mappings (evidence: `taskHashTable.cpp`)
- Huffman task → Huffman coder: uses coder (evidence: `taskHuffman.cpp`)
- Huffman coder → Dynamic array: stores codes (evidence: `structures/huffmanTree.cpp`)
- Histogram task → Dynamic array: uses array (evidence: `taskHystogramm.cpp`)
- LFU manager → LFU cache: gets and puts (evidence: `taskLFU.cpp`)
- Postfix evaluator → Stack: evaluates with (evidence: `taskStack.cpp`)
