# fredyhdz-23/notebook-competitive-programming architecture

> Architecture diagram of the GitHub repository fredyhdz-23/notebook-competitive-programming, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fredyhdz-23/notebook-competitive-programming
- Repository: https://github.com/fredyhdz-23/notebook-competitive-programming

## Overview

This is a personal C++ competitive-programming handbook for ICPC: programmers consult reusable algorithms, data structures, and contest templates while solving problems. Its contents are independent snippets rather than a connected application, so the graph groups them by domain and does not imply calls or a runtime pipeline. The README establishes the handbook’s purpose; the sampled files show representative implementations, while other listed modules are included by their documented paths and names.

Main entry points: [`cp-notebook`](https://github.com/fredyhdz-23/notebook-competitive-programming/tree/main/cp-notebook) (C++ handbook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_templates["Contest toolkit"]
  node_handbook["C++ handbook"]
  node_template["Contest template<br/>[template.cpp]"]
  node_snippets["Utility snippets<br/>[snippets.cpp]"]
end

subgraph group_structures["Data structures"]
  node_dsu["Disjoint sets<br/>[dsu.cpp]"]
  node_fenwick["Fenwick tree<br/>[fenwick_tree.cpp]"]
  node_segmenttree["Segment tree<br/>[segment_tree.cpp]"]
  node_sparse["Sparse table<br/>[sparse_table.cpp]"]
end

subgraph group_algorithms["Algorithms"]
  node_binarysearch["Answer search"]
  node_prefix2d["2D prefix sums<br/>[prefix_sums_2d.cpp]"]
  node_twopointers["Two pointers<br/>[two_pointers.cpp]"]
  node_coinchange["Coin change<br/>[coin_change.cpp]"]
  node_knapsack["Knapsack<br/>[knapsack.cpp]"]
  node_lis["Longest increasing subsequence<br/>[lis.cpp]"]
  node_bfsdfs["BFS and DFS<br/>[bfs_dfs.cpp]"]
  node_cycles["Cycle finding<br/>[Find_cycle.cpp]"]
  node_dijkstra["Dijkstra<br/>[dijkstra.cpp]"]
  node_floodfill["Flood fill<br/>[flood_fill.cpp]"]
  node_floyd["Floyd–Warshall<br/>[floyd_warshall.cpp]"]
  node_kruskal["Kruskal MST<br/>[kruskal_mst.cpp]"]
  node_toposort["Topological sort"]
  node_dinic["Dinic max flow<br/>[Dinic's.cpp]"]
  node_combinatorics["Modular combinatorics"]
  node_euclid["Extended Euclid"]
  node_sieve["Sieve and modular power"]
end

subgraph group_strings["String algorithms"]
  node_aho["Aho–Corasick<br/>[Aho_Corasick.cpp]"]
  node_suffix["Suffix array<br/>[Suffix_array.cpp]"]
  node_zfunction["Z function<br/>[Z_Function.cpp]"]
  node_hashing["String hashing<br/>[hashing.cpp]"]
  node_kmp["KMP<br/>[kmp.cpp]"]
  node_manacher["Manacher<br/>[manacher.cpp]"]
end

node_programmer(("Competitive programmer"))

node_programmer -->|"consults"| node_handbook

click node_handbook "https://github.com/fredyhdz-23/notebook-competitive-programming/tree/main/cp-notebook"
click node_template "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/template.cpp"
click node_snippets "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/utils/snippets.cpp"
click node_binarysearch "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/misc/binary_search_on_answer.cpp"
click node_prefix2d "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/misc/prefix_sums_2d.cpp"
click node_twopointers "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/misc/two_pointers.cpp"
click node_coinchange "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/dp/coin_change.cpp"
click node_knapsack "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/dp/knapsack.cpp"
click node_lis "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/dp/lis.cpp"
click node_bfsdfs "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/bfs_dfs.cpp"
click node_cycles "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/Find_cycle.cpp"
click node_dijkstra "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/dijkstra.cpp"
click node_floodfill "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/flood_fill.cpp"
click node_floyd "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/floyd_warshall.cpp"
click node_kruskal "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/kruskal_mst.cpp"
click node_toposort "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/topological_sort.cpp"
click node_dinic "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/flujos/Dinic's.cpp"
click node_combinatorics "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/math/combinatorics_mod.cpp"
click node_euclid "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/math/gcd_extended_euclid.cpp"
click node_sieve "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/math/sieve_and_modpow.cpp"
click node_dsu "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/dsu.cpp"
click node_fenwick "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/fenwick_tree.cpp"
click node_segmenttree "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/segment_tree.cpp"
click node_sparse "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/sparse_table.cpp"
click node_aho "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/Aho_Corasick.cpp"
click node_suffix "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/Suffix_array.cpp"
click node_zfunction "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/Z_Function.cpp"
click node_hashing "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/hashing.cpp"
click node_kmp "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/kmp.cpp"
click node_manacher "https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/manacher.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_handbook,node_template,node_snippets toneBlue
class node_dsu,node_fenwick,node_segmenttree,node_sparse toneAmber
class node_binarysearch,node_prefix2d,node_twopointers,node_coinchange,node_knapsack,node_lis,node_bfsdfs,node_cycles,node_dijkstra,node_floodfill,node_floyd,node_kruskal,node_toposort,node_dinic,node_combinatorics,node_euclid,node_sieve toneMint
class node_aho,node_suffix,node_zfunction,node_hashing,node_kmp,node_manacher toneRose
class node_programmer toneIndigo
```

## Components

### Contest toolkit

- [C++ handbook](https://github.com/fredyhdz-23/notebook-competitive-programming/tree/main/cp-notebook): `cp-notebook`
- [Contest template](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/template.cpp): `cp-notebook/template.cpp`
- [Utility snippets](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/utils/snippets.cpp): `cp-notebook/utils/snippets.cpp`

### Data structures

- [Disjoint sets](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/dsu.cpp): `cp-notebook/data_structures/dsu.cpp`
- [Fenwick tree](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/fenwick_tree.cpp): `cp-notebook/data_structures/fenwick_tree.cpp`
- [Segment tree](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/segment_tree.cpp): `cp-notebook/data_structures/segment_tree.cpp`
- [Sparse table](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/data_structures/sparse_table.cpp): `cp-notebook/data_structures/sparse_table.cpp`

### Algorithms

- [Answer search](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/misc/binary_search_on_answer.cpp): `cp-notebook/misc/binary_search_on_answer.cpp`
- [2D prefix sums](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/misc/prefix_sums_2d.cpp): `cp-notebook/misc/prefix_sums_2d.cpp`
- [Two pointers](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/misc/two_pointers.cpp): `cp-notebook/misc/two_pointers.cpp`
- [Coin change](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/dp/coin_change.cpp): `cp-notebook/dp/coin_change.cpp`
- [Knapsack](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/dp/knapsack.cpp): `cp-notebook/dp/knapsack.cpp`
- [Longest increasing subsequence](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/dp/lis.cpp): `cp-notebook/dp/lis.cpp`
- [BFS and DFS](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/bfs_dfs.cpp): `cp-notebook/graphs/bfs_dfs.cpp`
- [Cycle finding](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/Find_cycle.cpp): `cp-notebook/graphs/Find_cycle.cpp`
- [Dijkstra](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/dijkstra.cpp): `cp-notebook/graphs/dijkstra.cpp`
- [Flood fill](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/flood_fill.cpp): `cp-notebook/graphs/flood_fill.cpp`
- [Floyd–Warshall](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/floyd_warshall.cpp): `cp-notebook/graphs/floyd_warshall.cpp`
- [Kruskal MST](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/kruskal_mst.cpp): `cp-notebook/graphs/kruskal_mst.cpp`
- [Topological sort](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/graphs/topological_sort.cpp): `cp-notebook/graphs/topological_sort.cpp`
- [Dinic max flow](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/flujos/Dinic's.cpp): `cp-notebook/flujos/Dinic's.cpp`
- [Modular combinatorics](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/math/combinatorics_mod.cpp): `cp-notebook/math/combinatorics_mod.cpp`
- [Extended Euclid](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/math/gcd_extended_euclid.cpp): `cp-notebook/math/gcd_extended_euclid.cpp`
- [Sieve and modular power](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/math/sieve_and_modpow.cpp): `cp-notebook/math/sieve_and_modpow.cpp`

### String algorithms

- [Aho–Corasick](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/Aho_Corasick.cpp): `cp-notebook/strings/Aho_Corasick.cpp`
- [Suffix array](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/Suffix_array.cpp): `cp-notebook/strings/Suffix_array.cpp`
- [Z function](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/Z_Function.cpp): `cp-notebook/strings/Z_Function.cpp`
- [String hashing](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/hashing.cpp): `cp-notebook/strings/hashing.cpp`
- [KMP](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/kmp.cpp): `cp-notebook/strings/kmp.cpp`
- [Manacher](https://github.com/fredyhdz-23/notebook-competitive-programming/blob/main/cp-notebook/strings/manacher.cpp): `cp-notebook/strings/manacher.cpp`

### Other components

- **Competitive programmer**

## Connections

- Competitive programmer → C++ handbook: consults (evidence: `README.md`)
