# krahets/hello-algo architecture

> Architecture diagram of the GitHub repository krahets/hello-algo, 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/krahets/hello-algo
- Repository: https://github.com/krahets/hello-algo

## Overview

Hello Algo is an open, beginner-oriented data-structures-and-algorithms tutorial, with animated explanations and runnable examples in multiple languages. The principal learning workflow is for a reader to study a topic, run its example, and inspect the demonstrated result. The tree supports the breadth of the code examples; the README describes the visual and written tutorial, but those assets are not represented in the supplied tree. The sampled tree examples show implementations and printed demonstrations; other topic links reflect the chapter organization, not inspected call relationships.

Main entry points: [`codes`](https://github.com/krahets/hello-algo/tree/main/codes) (Multilanguage Examples), [`codes/cpp/chapter_tree/binary_search_tree.cpp`](https://github.com/krahets/hello-algo/blob/main/codes/cpp/chapter_tree/binary_search_tree.cpp) (BST Demonstration), [`codes/cpp/chapter_computational_complexity`](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_computational_complexity) (Complexity), [`codes/cpp/chapter_array_and_linkedlist`](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_array_and_linkedlist) (Arrays & Lists)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["Foundations"]
  node_complexity["Complexity"]
end

subgraph group_structures["Data Structures"]
  node_arrays["Arrays &amp; Lists"]
  node_stacks["Stacks &amp; Queues"]
  node_trees["Trees"]
  node_hashing["Hashing"]
  node_heaps["Heaps"]
end

subgraph group_algorithms["Algorithms"]
  node_searching["Searching"]
  node_sorting["Sorting"]
  node_graph["Graph Algorithms"]
  node_divide["Divide &amp; Conquer"]
  node_dynamic["Dynamic Programming"]
  node_backtracking["Backtracking"]
  node_greedy["Greedy Algorithms"]
end

subgraph group_examples["Runnable Examples"]
  node_examples["Multilanguage Examples"]
  node_bst["BST Demonstration"]
  node_tree_utils["Tree Utilities<br/>[common.hpp]"]
end

node_reader(("Reader"))

node_reader -->|"studies and runs"| node_examples
node_examples -->|"includes topics"| node_complexity
node_examples -->|"includes topics"| node_arrays
node_examples -->|"includes topics"| node_stacks
node_examples -->|"includes topics"| node_trees
node_examples -->|"includes topics"| node_hashing
node_examples -->|"includes topics"| node_heaps
node_examples -->|"includes topics"| node_searching
node_examples -->|"includes topics"| node_sorting
node_examples -->|"includes topics"| node_graph
node_examples -->|"includes topics"| node_divide
node_examples -->|"includes topics"| node_dynamic
node_examples -->|"includes topics"| node_backtracking
node_examples -->|"includes topics"| node_greedy
node_bst -->|"uses tree helpers"| node_tree_utils

click node_complexity "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_computational_complexity"
click node_arrays "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_array_and_linkedlist"
click node_stacks "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_stack_and_queue"
click node_trees "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_tree"
click node_hashing "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_hashing"
click node_heaps "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_heap"
click node_searching "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_searching"
click node_sorting "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_sorting"
click node_graph "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_graph"
click node_divide "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_divide_and_conquer"
click node_dynamic "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_dynamic_programming"
click node_backtracking "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_backtracking"
click node_greedy "https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_greedy"
click node_examples "https://github.com/krahets/hello-algo/tree/main/codes"
click node_bst "https://github.com/krahets/hello-algo/blob/main/codes/cpp/chapter_tree/binary_search_tree.cpp"
click node_tree_utils "https://github.com/krahets/hello-algo/blob/main/codes/cpp/utils/common.hpp"

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_complexity toneBlue
class node_arrays,node_stacks,node_trees,node_hashing,node_heaps toneAmber
class node_searching,node_sorting,node_graph,node_divide,node_dynamic,node_backtracking,node_greedy toneMint
class node_examples,node_bst,node_tree_utils toneRose
class node_reader toneIndigo
```

## Components

### Foundations

- [Complexity](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_computational_complexity): `codes/cpp/chapter_computational_complexity`

### Data Structures

- [Arrays & Lists](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_array_and_linkedlist): `codes/cpp/chapter_array_and_linkedlist`
- [Stacks & Queues](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_stack_and_queue): `codes/cpp/chapter_stack_and_queue`
- [Trees](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_tree): `codes/cpp/chapter_tree`
- [Hashing](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_hashing): `codes/cpp/chapter_hashing`
- [Heaps](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_heap): `codes/cpp/chapter_heap`

### Algorithms

- [Searching](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_searching): `codes/cpp/chapter_searching`
- [Sorting](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_sorting): `codes/cpp/chapter_sorting`
- [Graph Algorithms](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_graph): `codes/cpp/chapter_graph`
- [Divide & Conquer](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_divide_and_conquer): `codes/cpp/chapter_divide_and_conquer`
- [Dynamic Programming](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_dynamic_programming): `codes/cpp/chapter_dynamic_programming`
- [Backtracking](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_backtracking): `codes/cpp/chapter_backtracking`
- [Greedy Algorithms](https://github.com/krahets/hello-algo/tree/main/codes/cpp/chapter_greedy): `codes/cpp/chapter_greedy`

### Runnable Examples

- [Multilanguage Examples](https://github.com/krahets/hello-algo/tree/main/codes): `codes`
- [BST Demonstration](https://github.com/krahets/hello-algo/blob/main/codes/cpp/chapter_tree/binary_search_tree.cpp): `codes/cpp/chapter_tree/binary_search_tree.cpp`
- [Tree Utilities](https://github.com/krahets/hello-algo/blob/main/codes/cpp/utils/common.hpp): `codes/cpp/utils/common.hpp`

### Other components

- **Reader**

## Connections

- Reader → Multilanguage Examples: studies and runs
- Multilanguage Examples → Complexity: includes topics
- Multilanguage Examples → Arrays & Lists: includes topics
- Multilanguage Examples → Stacks & Queues: includes topics
- Multilanguage Examples → Trees: includes topics
- Multilanguage Examples → Hashing: includes topics
- Multilanguage Examples → Heaps: includes topics
- Multilanguage Examples → Searching: includes topics
- Multilanguage Examples → Sorting: includes topics
- Multilanguage Examples → Graph Algorithms: includes topics
- Multilanguage Examples → Divide & Conquer: includes topics
- Multilanguage Examples → Dynamic Programming: includes topics
- Multilanguage Examples → Backtracking: includes topics
- Multilanguage Examples → Greedy Algorithms: includes topics
- BST Demonstration → Tree Utilities: uses tree helpers
