# yxn4065/datastructure-2021 architecture

> Architecture diagram of the GitHub repository yxn4065/datastructure-2021, 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/yxn4065/datastructure-2021
- Repository: https://github.com/yxn4065/datastructure-2021

## Overview

This repository contains four independent C++ course projects: a student address book, Huffman encoder/decoder, traffic consultation system, and library manager. Their common user flow is menu-driven input followed by a domain operation and, where documented, file-backed data access or output. The README describes capabilities but no source excerpts were provided, so internal call structure is not verified; the edges below reflect only documented behavior.

Main entry points: [`Huffman/HuffmanCoding.cpp`](https://github.com/yxn4065/datastructure-2021/blob/main/Huffman/HuffmanCoding.cpp) (Huffman Tool), [`LibrarySystem/LibraryManageSystem.cpp`](https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/LibraryManageSystem.cpp) (Library Manager), [`StudentAddressBookSystem/StudentAddress.cpp`](https://github.com/yxn4065/datastructure-2021/blob/main/StudentAddressBookSystem/StudentAddress.cpp) (Address Book), [`TrafficMap/map.cpp`](https://github.com/yxn4065/datastructure-2021/blob/main/TrafficMap/map.cpp) (Traffic Consultant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_address["Student Address Book"]
  node_address_app["Address Book<br/>[StudentAddress.cpp]"]
  node_address_ops["Contact Operations<br/>[StudentAddress.cpp]"]
  node_address_store[("Contact File<br/>[Address_book.txt]")]
end

subgraph group_huffman["Huffman Coding"]
  node_huffman_app["Huffman Tool<br/>[HuffmanCoding.cpp]"]
  node_huffman_encode["Encode Message<br/>[HuffmanCoding.cpp]"]
  node_huffman_decode["Decode Message<br/>[HuffmanCoding.cpp]"]
  node_huffman_files[("Code Files")]
end

subgraph group_traffic["Traffic Consultation"]
  node_traffic_app["Traffic Consultant<br/>[map.cpp]"]
  node_traffic_routes["Route Queries<br/>[map.cpp]"]
  node_traffic_map[("Map Data<br/>[map.txt]")]
end

subgraph group_library["Library Management"]
  node_library_app["Library Manager"]
  node_library_catalog["Book Services"]
  node_library_users["Reader Services"]
  node_library_books[("Book Records<br/>[library.txt]")]
  node_library_accounts[("User Records<br/>[user.txt]")]
end

node_user(("User"))

node_user -->|"uses"| node_address_app
node_address_app -->|"offers"| node_address_ops
node_address_ops -->|"reads and writes"| node_address_store
node_user -->|"uses"| node_huffman_app
node_huffman_app -->|"encodes"| node_huffman_encode
node_huffman_app -->|"decodes"| node_huffman_decode
node_huffman_app -->|"stores codes"| node_huffman_files
node_user -->|"uses"| node_traffic_app
node_traffic_app -->|"answers queries"| node_traffic_routes
node_traffic_routes -.->|"uses map data"| node_traffic_map
node_user -->|"uses"| node_library_app
node_library_app -->|"offers"| node_library_catalog
node_library_app -->|"offers"| node_library_users
node_library_catalog -->|"reads and writes"| node_library_books
node_library_users -->|"reads and writes"| node_library_accounts

click node_address_app "https://github.com/yxn4065/datastructure-2021/blob/main/StudentAddressBookSystem/StudentAddress.cpp"
click node_address_ops "https://github.com/yxn4065/datastructure-2021/blob/main/StudentAddressBookSystem/StudentAddress.cpp"
click node_address_store "https://github.com/yxn4065/datastructure-2021/blob/main/StudentAddressBookSystem/Address_book.txt"
click node_huffman_app "https://github.com/yxn4065/datastructure-2021/blob/main/Huffman/HuffmanCoding.cpp"
click node_huffman_encode "https://github.com/yxn4065/datastructure-2021/blob/main/Huffman/HuffmanCoding.cpp"
click node_huffman_decode "https://github.com/yxn4065/datastructure-2021/blob/main/Huffman/HuffmanCoding.cpp"
click node_huffman_files "https://github.com/yxn4065/datastructure-2021/tree/main/Huffman/huffman_temp"
click node_traffic_app "https://github.com/yxn4065/datastructure-2021/blob/main/TrafficMap/map.cpp"
click node_traffic_routes "https://github.com/yxn4065/datastructure-2021/blob/main/TrafficMap/map.cpp"
click node_traffic_map "https://github.com/yxn4065/datastructure-2021/blob/main/TrafficMap/map.txt"
click node_library_app "https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/LibraryManageSystem.cpp"
click node_library_catalog "https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/LibraryManageSystem.cpp"
click node_library_users "https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/LibraryManageSystem.cpp"
click node_library_books "https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/library.txt"
click node_library_accounts "https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/user.txt"

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_address_app,node_address_ops,node_address_store,node_user toneBlue
class node_huffman_app,node_huffman_encode,node_huffman_decode,node_huffman_files toneAmber
class node_traffic_app,node_traffic_routes,node_traffic_map toneMint
class node_library_app,node_library_catalog,node_library_users,node_library_books,node_library_accounts toneRose
```

## Components

### Student Address Book

- [Address Book](https://github.com/yxn4065/datastructure-2021/blob/main/StudentAddressBookSystem/StudentAddress.cpp): `StudentAddressBookSystem/StudentAddress.cpp`
- [Contact Operations](https://github.com/yxn4065/datastructure-2021/blob/main/StudentAddressBookSystem/StudentAddress.cpp): `StudentAddressBookSystem/StudentAddress.cpp`
- [Contact File](https://github.com/yxn4065/datastructure-2021/blob/main/StudentAddressBookSystem/Address_book.txt): `StudentAddressBookSystem/Address_book.txt`

### Huffman Coding

- [Huffman Tool](https://github.com/yxn4065/datastructure-2021/blob/main/Huffman/HuffmanCoding.cpp): `Huffman/HuffmanCoding.cpp`
- [Encode Message](https://github.com/yxn4065/datastructure-2021/blob/main/Huffman/HuffmanCoding.cpp): `Huffman/HuffmanCoding.cpp`
- [Decode Message](https://github.com/yxn4065/datastructure-2021/blob/main/Huffman/HuffmanCoding.cpp): `Huffman/HuffmanCoding.cpp`
- [Code Files](https://github.com/yxn4065/datastructure-2021/tree/main/Huffman/huffman_temp): `Huffman/huffman_temp`

### Traffic Consultation

- [Traffic Consultant](https://github.com/yxn4065/datastructure-2021/blob/main/TrafficMap/map.cpp): `TrafficMap/map.cpp`
- [Route Queries](https://github.com/yxn4065/datastructure-2021/blob/main/TrafficMap/map.cpp): `TrafficMap/map.cpp`
- [Map Data](https://github.com/yxn4065/datastructure-2021/blob/main/TrafficMap/map.txt): `TrafficMap/map.txt`

### Library Management

- [Library Manager](https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/LibraryManageSystem.cpp): `LibrarySystem/LibraryManageSystem.cpp`
- [Book Services](https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/LibraryManageSystem.cpp): `LibrarySystem/LibraryManageSystem.cpp`
- [Reader Services](https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/LibraryManageSystem.cpp): `LibrarySystem/LibraryManageSystem.cpp`
- [Book Records](https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/library.txt): `LibrarySystem/library.txt`
- [User Records](https://github.com/yxn4065/datastructure-2021/blob/main/LibrarySystem/user.txt): `LibrarySystem/user.txt`

### Other components

- **User**

## Connections

- User → Address Book: uses (evidence: `README.md`)
- Address Book → Contact Operations: offers (evidence: `README.md`)
- Contact Operations → Contact File: reads and writes (evidence: `README.md`)
- User → Huffman Tool: uses (evidence: `README.md`)
- Huffman Tool → Encode Message: encodes (evidence: `README.md`)
- Huffman Tool → Decode Message: decodes (evidence: `README.md`)
- Huffman Tool → Code Files: stores codes (evidence: `README.md`)
- User → Traffic Consultant: uses (evidence: `README.md`)
- Traffic Consultant → Route Queries: answers queries (evidence: `README.md`)
- Route Queries → Map Data: uses map data
- User → Library Manager: uses (evidence: `README.md`)
- Library Manager → Book Services: offers (evidence: `README.md`)
- Library Manager → Reader Services: offers (evidence: `README.md`)
- Book Services → Book Records: reads and writes (evidence: `README.md`)
- Reader Services → User Records: reads and writes (evidence: `README.md`)
