# algorithmzuo/algorithm-journey architecture

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

- Interactive diagram: https://gitdiagram.com/algorithmzuo/algorithm-journey
- Repository: https://github.com/algorithmzuo/algorithm-journey

## Overview

This repository is a collection of standalone Java algorithm examples and problem solutions, rather than a single application. The typical workflow is to provide input to a selected program, which computes and prints a result. The tree indicates broad coverage from basic algorithms through graph, dynamic-programming, string, and range-query problems; sampled programs confirm several query-processing approaches. There is no README, and the excerpts do not establish a shared runtime or links between examples, so the graph shows independent programs rather than an invented pipeline.

Main entry points: [`src/class004/SelectBubbleInsert.java`](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class004/SelectBubbleInsert.java) (Sorting and search), [`src/class034/Code06_SortList.java`](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class034/Code06_SortList.java) (Linked lists), [`src/class036/Code05_PreorderSerializeAndDeserialize.java`](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class036/Code05_PreorderSerializeAndDeserialize.java) (Tree operations), [`src/class046/Code02_LongestSubarraySumEqualsAim.java`](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class046/Code02_LongestSubarraySumEqualsAim.java) (Prefix queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["Core structures"]
  node_intro["Sorting and search"]
  node_lists["Linked lists"]
  node_trees["Tree operations"]
end

subgraph group_arrays["Array queries"]
  node_prefix["Prefix queries"]
  node_windows["Window algorithms"]
  node_range["Segment tree"]
  node_zeroquery["Zero-sum queries"]
  node_simplequery["Frequency queries"]
end

subgraph group_graphs["Graph and tree"]
  node_graph["Graph algorithms"]
  node_shortest["Shortest paths"]
  node_pathquery["Tree path queries"]
  node_packagemgr["Package dependencies"]
  node_watermanager["Dynamic graph queries"]
end

subgraph group_optimization["Optimization"]
  node_dp["Dynamic programming"]
  node_greedy["Greedy solutions"]
  node_kth["Kth-value queries"]
end

subgraph group_strings["String algorithms"]
  node_pattern["Pattern matching<br/>[Code01_KMP.java]"]
  node_trie["Trie algorithms"]
end

node_user(("Problem solver"))

node_user -->|"provides input"| node_intro
node_intro -->|"prints result"| node_user
node_user -->|"provides input"| node_lists
node_lists -->|"prints result"| node_user
node_user -->|"provides input"| node_trees
node_trees -->|"prints result"| node_user
node_user -->|"provides input"| node_prefix
node_prefix -->|"prints result"| node_user
node_user -->|"provides input"| node_windows
node_windows -->|"prints result"| node_user
node_user -->|"provides input"| node_range
node_range -->|"prints result"| node_user
node_user -->|"provides input"| node_zeroquery
node_zeroquery -->|"prints answers"| node_user
node_user -->|"provides input"| node_simplequery
node_simplequery -->|"prints answers"| node_user
node_user -->|"provides input"| node_graph
node_graph -->|"prints result"| node_user
node_user -->|"provides input"| node_shortest
node_shortest -->|"prints result"| node_user
node_user -->|"provides queries"| node_pathquery
node_pathquery -->|"returns answers"| node_user
node_user -->|"provides operations"| node_packagemgr
node_packagemgr -->|"prints answers"| node_user
node_user -->|"provides operations"| node_watermanager
node_watermanager -->|"prints answers"| node_user
node_user -->|"provides input"| node_dp
node_dp -->|"prints result"| node_user
node_user -->|"provides input"| node_greedy
node_greedy -->|"prints result"| node_user
node_user -->|"provides operations"| node_kth
node_kth -->|"prints answers"| node_user
node_user -->|"provides input"| node_pattern
node_pattern -->|"prints result"| node_user
node_user -->|"provides input"| node_trie
node_trie -->|"prints result"| node_user

click node_intro "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class004/SelectBubbleInsert.java"
click node_lists "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class034/Code06_SortList.java"
click node_trees "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class036/Code05_PreorderSerializeAndDeserialize.java"
click node_prefix "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class046/Code02_LongestSubarraySumEqualsAim.java"
click node_windows "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class049/Code03_MinimumWindowSubstring.java"
click node_range "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class111/Code04_QueryModUpdate.java"
click node_zeroquery "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class177/Code04_ZeroQuery1.java"
click node_simplequery "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class179/Code02_SimpleQuery1.java"
click node_graph "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class059/Code04_AlienDictionary.java"
click node_shortest "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class064/Code01_DijkstraLeetcode.java"
click node_pathquery "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class119/Code03_QueryPathMinimumChangesToSame.java"
click node_packagemgr "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class161/Code04_PackageManager1.java"
click node_watermanager "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class203/Code01_WaterManager1.java"
click node_dp "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class073/Code01_01Knapsack.java"
click node_greedy "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class089/Code05_CourseScheduleIII.java"
click node_kth "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class160/Code02_QueryKthMaximum1.java"
click node_pattern "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class100/Code01_KMP.java"
click node_trie "https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class044/Code01_TrieTree.java"

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_intro,node_lists,node_trees toneBlue
class node_prefix,node_windows,node_range,node_zeroquery,node_simplequery toneAmber
class node_graph,node_shortest,node_pathquery,node_packagemgr,node_watermanager toneMint
class node_dp,node_greedy,node_kth toneRose
class node_pattern,node_trie,node_user toneIndigo
```

## Components

### Core structures

- [Sorting and search](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class004/SelectBubbleInsert.java): `src/class004/SelectBubbleInsert.java`
- [Linked lists](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class034/Code06_SortList.java): `src/class034/Code06_SortList.java`
- [Tree operations](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class036/Code05_PreorderSerializeAndDeserialize.java): `src/class036/Code05_PreorderSerializeAndDeserialize.java`

### Array queries

- [Prefix queries](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class046/Code02_LongestSubarraySumEqualsAim.java): `src/class046/Code02_LongestSubarraySumEqualsAim.java`
- [Window algorithms](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class049/Code03_MinimumWindowSubstring.java): `src/class049/Code03_MinimumWindowSubstring.java`
- [Segment tree](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class111/Code04_QueryModUpdate.java): `src/class111/Code04_QueryModUpdate.java`
- [Zero-sum queries](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class177/Code04_ZeroQuery1.java): `src/class177/Code04_ZeroQuery1.java`
- [Frequency queries](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class179/Code02_SimpleQuery1.java): `src/class179/Code02_SimpleQuery1.java`

### Graph and tree

- [Graph algorithms](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class059/Code04_AlienDictionary.java): `src/class059/Code04_AlienDictionary.java`
- [Shortest paths](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class064/Code01_DijkstraLeetcode.java): `src/class064/Code01_DijkstraLeetcode.java`
- [Tree path queries](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class119/Code03_QueryPathMinimumChangesToSame.java): `src/class119/Code03_QueryPathMinimumChangesToSame.java`
- [Package dependencies](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class161/Code04_PackageManager1.java): `src/class161/Code04_PackageManager1.java`
- [Dynamic graph queries](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class203/Code01_WaterManager1.java): `src/class203/Code01_WaterManager1.java`

### Optimization

- [Dynamic programming](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class073/Code01_01Knapsack.java): `src/class073/Code01_01Knapsack.java`
- [Greedy solutions](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class089/Code05_CourseScheduleIII.java): `src/class089/Code05_CourseScheduleIII.java`
- [Kth-value queries](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class160/Code02_QueryKthMaximum1.java): `src/class160/Code02_QueryKthMaximum1.java`

### String algorithms

- [Pattern matching](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class100/Code01_KMP.java): `src/class100/Code01_KMP.java`
- [Trie algorithms](https://github.com/algorithmzuo/algorithm-journey/blob/main/src/class044/Code01_TrieTree.java): `src/class044/Code01_TrieTree.java`

### Other components

- **Problem solver**

## Connections

- Problem solver → Sorting and search: provides input
- Sorting and search → Problem solver: prints result
- Problem solver → Linked lists: provides input
- Linked lists → Problem solver: prints result
- Problem solver → Tree operations: provides input
- Tree operations → Problem solver: prints result
- Problem solver → Prefix queries: provides input
- Prefix queries → Problem solver: prints result
- Problem solver → Window algorithms: provides input
- Window algorithms → Problem solver: prints result
- Problem solver → Segment tree: provides input
- Segment tree → Problem solver: prints result
- Problem solver → Zero-sum queries: provides input
- Zero-sum queries → Problem solver: prints answers
- Problem solver → Frequency queries: provides input
- Frequency queries → Problem solver: prints answers
- Problem solver → Graph algorithms: provides input
- Graph algorithms → Problem solver: prints result
- Problem solver → Shortest paths: provides input
- Shortest paths → Problem solver: prints result
- Problem solver → Tree path queries: provides queries
- Tree path queries → Problem solver: returns answers
- Problem solver → Package dependencies: provides operations
- Package dependencies → Problem solver: prints answers
- Problem solver → Dynamic graph queries: provides operations
- Dynamic graph queries → Problem solver: prints answers
- Problem solver → Dynamic programming: provides input
- Dynamic programming → Problem solver: prints result
- Problem solver → Greedy solutions: provides input
- Greedy solutions → Problem solver: prints result
- Problem solver → Kth-value queries: provides operations
- Kth-value queries → Problem solver: prints answers
- Problem solver → Pattern matching: provides input
- Pattern matching → Problem solver: prints result
- Problem solver → Trie algorithms: provides input
- Trie algorithms → Problem solver: prints result
