# egonschiele/grokking_algorithms architecture

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

- Interactive diagram: https://gitdiagram.com/egonschiele/grokking_algorithms
- Repository: https://github.com/egonschiele/grokking_algorithms

## Overview

This repository accompanies Grokking Algorithms: readers study standalone, readable implementations of the book’s concepts, often in several languages, and inspect their results. The tree shows coverage from search and sorting through graph algorithms and dynamic programming; sampled programs demonstrate console output, but the examples are not wired into a shared application. Paths identify representative implementations. Some capabilities are evident from the tree but their internal wiring was not sampled.

Main entry points: [`01_introduction_to_algorithms/python/binary_search.py`](https://github.com/egonschiele/grokking_algorithms/blob/master/01_introduction_to_algorithms/python/binary_search.py) (Binary search), [`02_selection_sort/csharp/01_selection_sort/Program.cs`](https://github.com/egonschiele/grokking_algorithms/blob/master/02_selection_sort/csharp/01_selection_sort/Program.cs) (Selection sort), [`04_quicksort/rust/src/main.rs`](https://github.com/egonschiele/grokking_algorithms/blob/master/04_quicksort/rust/src/main.rs) (Quicksort and basics), [`06_breadth-first_search/rust/src/main.rs`](https://github.com/egonschiele/grokking_algorithms/blob/master/06_breadth-first_search/rust/src/main.rs) (Breadth-first search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_fundamentals["Search and sorting"]
  node_binary["Binary search<br/>[binary_search.py]"]
  node_selection["Selection sort<br/>[Program.cs]"]
  node_recursion["Recursion examples<br/>[03_factorial.py]"]
  node_quick["Quicksort and basics<br/>[main.rs]"]
end

subgraph group_structures["Data structures"]
  node_hash["Hash tables<br/>[03_hashtable.js]"]
end

subgraph group_graphs["Graph algorithms"]
  node_bfs["Breadth-first search<br/>[main.rs]"]
  node_trees["Tree traversal<br/>[Main.java]"]
  node_dijkstra["Dijkstra’s algorithm<br/>[main.rs]"]
end

subgraph group_optimization["Optimization"]
  node_greedy["Greedy set cover<br/>[main.rs]"]
  node_dynamic["Dynamic programming<br/>[main.rs]"]
end

node_reader(("Reader"))
node_console["Example output"]

node_reader -->|"studies"| node_binary
node_reader -->|"studies"| node_selection
node_reader -->|"studies"| node_recursion
node_reader -->|"studies"| node_quick
node_reader -->|"studies"| node_hash
node_reader -->|"studies"| node_bfs
node_reader -->|"studies"| node_trees
node_reader -->|"studies"| node_dijkstra
node_reader -->|"studies"| node_greedy
node_reader -->|"studies"| node_dynamic
node_binary -->|"prints or returns"| node_console
node_selection -->|"prints result"| node_console
node_quick -->|"prints results"| node_console
node_bfs -->|"prints search result"| node_console
node_trees -->|"prints file names"| node_console
node_dijkstra -->|"prints costs"| node_console
node_greedy -->|"prints stations"| node_console
node_dynamic -->|"prints tables"| node_console

click node_binary "https://github.com/egonschiele/grokking_algorithms/blob/master/01_introduction_to_algorithms/python/binary_search.py"
click node_selection "https://github.com/egonschiele/grokking_algorithms/blob/master/02_selection_sort/csharp/01_selection_sort/Program.cs"
click node_recursion "https://github.com/egonschiele/grokking_algorithms/blob/master/03_recursion/python/03_factorial.py"
click node_quick "https://github.com/egonschiele/grokking_algorithms/blob/master/04_quicksort/rust/src/main.rs"
click node_hash "https://github.com/egonschiele/grokking_algorithms/blob/master/05_hash_tables/javascript/03_hashtable.js"
click node_bfs "https://github.com/egonschiele/grokking_algorithms/blob/master/06_breadth-first_search/rust/src/main.rs"
click node_trees "https://github.com/egonschiele/grokking_algorithms/blob/master/07_trees/java/Main.java"
click node_dijkstra "https://github.com/egonschiele/grokking_algorithms/blob/master/09_dijkstras_algorithm/rust/src/main.rs"
click node_greedy "https://github.com/egonschiele/grokking_algorithms/blob/master/10_greedy_algorithms/rust/src/main.rs"
click node_dynamic "https://github.com/egonschiele/grokking_algorithms/blob/master/11_dynamic_programming/rust/src/main.rs"

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_binary,node_selection,node_recursion,node_quick toneBlue
class node_hash toneAmber
class node_bfs,node_trees,node_dijkstra toneMint
class node_greedy,node_dynamic toneRose
class node_reader,node_console toneIndigo
```

## Components

### Search and sorting

- [Binary search](https://github.com/egonschiele/grokking_algorithms/blob/master/01_introduction_to_algorithms/python/binary_search.py): `01_introduction_to_algorithms/python/binary_search.py`
- [Selection sort](https://github.com/egonschiele/grokking_algorithms/blob/master/02_selection_sort/csharp/01_selection_sort/Program.cs): `02_selection_sort/csharp/01_selection_sort/Program.cs`
- [Recursion examples](https://github.com/egonschiele/grokking_algorithms/blob/master/03_recursion/python/03_factorial.py): `03_recursion/python/03_factorial.py`
- [Quicksort and basics](https://github.com/egonschiele/grokking_algorithms/blob/master/04_quicksort/rust/src/main.rs): `04_quicksort/rust/src/main.rs`

### Data structures

- [Hash tables](https://github.com/egonschiele/grokking_algorithms/blob/master/05_hash_tables/javascript/03_hashtable.js): `05_hash_tables/javascript/03_hashtable.js`

### Graph algorithms

- [Breadth-first search](https://github.com/egonschiele/grokking_algorithms/blob/master/06_breadth-first_search/rust/src/main.rs): `06_breadth-first_search/rust/src/main.rs`
- [Tree traversal](https://github.com/egonschiele/grokking_algorithms/blob/master/07_trees/java/Main.java): `07_trees/java/Main.java`
- [Dijkstra’s algorithm](https://github.com/egonschiele/grokking_algorithms/blob/master/09_dijkstras_algorithm/rust/src/main.rs): `09_dijkstras_algorithm/rust/src/main.rs`

### Optimization

- [Greedy set cover](https://github.com/egonschiele/grokking_algorithms/blob/master/10_greedy_algorithms/rust/src/main.rs): `10_greedy_algorithms/rust/src/main.rs`
- [Dynamic programming](https://github.com/egonschiele/grokking_algorithms/blob/master/11_dynamic_programming/rust/src/main.rs): `11_dynamic_programming/rust/src/main.rs`

### Other components

- **Reader**
- **Example output**

## Connections

- Reader → Binary search: studies
- Reader → Selection sort: studies
- Reader → Recursion examples: studies
- Reader → Quicksort and basics: studies
- Reader → Hash tables: studies
- Reader → Breadth-first search: studies
- Reader → Tree traversal: studies
- Reader → Dijkstra’s algorithm: studies
- Reader → Greedy set cover: studies
- Reader → Dynamic programming: studies
- Binary search → Example output: prints or returns
- Selection sort → Example output: prints result
- Quicksort and basics → Example output: prints results
- Breadth-first search → Example output: prints search result
- Tree traversal → Example output: prints file names
- Dijkstra’s algorithm → Example output: prints costs
- Greedy set cover → Example output: prints stations
- Dynamic programming → Example output: prints tables
