# williamfiset/algorithms architecture

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

- Interactive diagram: https://gitdiagram.com/williamfiset/algorithms
- Repository: https://github.com/williamfiset/algorithms

## Overview

This repository is a teaching collection of standalone data-structure and algorithm implementations, not a single application. The principal workflow is that a programmer chooses an implementation, invokes its API or example entry point, and observes a computed result. Its major branches cover data structures, graph algorithms, dynamic programming, geometry, algebra, math, searching, sorting, and strings. Edges are limited to documented invocation and relationships visible in the supplied excerpts or SOURCE INDEX; unsampled implementations are represented at their existing directory paths.

Main entry points: [`src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/BinarySearchTree.java`](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/BinarySearchTree.java) (Binary search tree), [`src/main/java/com/williamfiset/algorithms/datastructures/fibonacciheap/FibonacciHeap.java`](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/fibonacciheap/FibonacciHeap.java) (Fibonacci heap), [`src/main/java/com/williamfiset/algorithms/datastructures/queue/Queue.java`](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/queue/Queue.java) (Queue interface), [`src/main/java/com/williamfiset/algorithms/datastructures/stack/Stack.java`](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/stack/Stack.java) (Stack interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ds["Data structures"]
  node_avl["AVL tree"]
  node_bst["Binary search tree"]
  node_traversal["Traversal order"]
  node_array["Dynamic array<br/>[IntArray.java]"]
  node_fenwick["Fenwick trees"]
  node_fibheap["Fibonacci heap<br/>[FibonacciHeap.java]"]
  node_queue["Queue interface<br/>[Queue.java]"]
  node_segment["Segment trees"]
  node_segmentnode["Pointer segment tree<br/>[Node.java]"]
  node_sumsegment["Sum segment tree"]
  node_multsegment["Multiplication updates"]
  node_stack["Stack interface<br/>[Stack.java]"]
  node_suffixarray["Suffix arrays"]
  node_quad["Quad tree<br/>[QuadTree.java]"]
end

subgraph group_graph["Graph algorithms"]
  node_graphalg["Graph algorithms"]
  node_primanalysis["Prim analysis"]
  node_networkbase["Flow solver base"]
  node_mincostflow["Min-cost flow"]
  node_treealg["Tree algorithms"]
end

subgraph group_optimization["Optimization"]
  node_dp["Dynamic programming"]
  node_geometry["Geometry"]
end

subgraph group_computing["Core computing"]
  node_linear["Linear algebra"]
  node_math["Mathematics"]
end

subgraph group_sequence["Sequence algorithms"]
  node_search["Searching"]
  node_sorting["Sorting"]
  node_strings["String algorithms"]
end

node_programmer(("Programmer"))

node_programmer -->|"runs implementation"| node_search
node_programmer -->|"uses implementation"| node_bst
node_bst -->|"uses traversal order"| node_traversal
node_bst -->|"uses queue"| node_queue
node_avl -->|"uses stack"| node_stack
node_fibheap -->|"uses queue"| node_queue
node_fibheap -->|"uses stack"| node_stack
node_primanalysis -->|"benchmarks Prim"| node_search
node_mincostflow -->|"extends solver"| node_networkbase
node_multsegment -->|"example constructs"| node_sumsegment

click node_avl "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/balancedtree/AVLTreeRecursiveOptimized.java"
click node_bst "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/BinarySearchTree.java"
click node_traversal "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/TreeTraversalOrder.java"
click node_array "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/dynamicarray/IntArray.java"
click node_fenwick "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/datastructures/fenwicktree"
click node_fibheap "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/fibonacciheap/FibonacciHeap.java"
click node_queue "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/queue/Queue.java"
click node_segment "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree"
click node_segmentnode "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/Node.java"
click node_sumsegment "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/SumQuerySumUpdateSegmentTree.java"
click node_multsegment "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/SumQueryMultiplicationUpdateSegmentTree.java"
click node_stack "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/stack/Stack.java"
click node_suffixarray "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/datastructures/suffixarray"
click node_quad "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/quadtree/QuadTree.java"
click node_graphalg "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/graphtheory"
click node_primanalysis "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/analysis/PrimsGraphRepresentationAnaylsis.java"
click node_networkbase "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/NetworkFlowSolverBase.java"
click node_mincostflow "https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/MinCostMaxFlowWithBellmanFord.java"
click node_treealg "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/graphtheory/treealgorithms"
click node_dp "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/dp"
click node_geometry "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/geometry"
click node_linear "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/linearalgebra"
click node_math "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/math"
click node_search "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/search"
click node_sorting "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/sorting"
click node_strings "https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/strings"

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_avl,node_bst,node_traversal,node_array,node_fenwick,node_fibheap,node_queue,node_segment,node_segmentnode,node_sumsegment,node_multsegment,node_stack,node_suffixarray,node_quad toneBlue
class node_graphalg,node_primanalysis,node_networkbase,node_mincostflow,node_treealg toneAmber
class node_dp,node_geometry toneMint
class node_linear,node_math toneRose
class node_search,node_sorting,node_strings,node_programmer toneIndigo
```

## Components

### Data structures

- [AVL tree](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/balancedtree/AVLTreeRecursiveOptimized.java): `src/main/java/com/williamfiset/algorithms/datastructures/balancedtree/AVLTreeRecursiveOptimized.java`
- [Binary search tree](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/BinarySearchTree.java): `src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/BinarySearchTree.java`
- [Traversal order](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/TreeTraversalOrder.java): `src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/TreeTraversalOrder.java`
- [Dynamic array](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/dynamicarray/IntArray.java): `src/main/java/com/williamfiset/algorithms/datastructures/dynamicarray/IntArray.java`
- [Fenwick trees](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/datastructures/fenwicktree): `src/main/java/com/williamfiset/algorithms/datastructures/fenwicktree`
- [Fibonacci heap](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/fibonacciheap/FibonacciHeap.java): `src/main/java/com/williamfiset/algorithms/datastructures/fibonacciheap/FibonacciHeap.java`
- [Queue interface](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/queue/Queue.java): `src/main/java/com/williamfiset/algorithms/datastructures/queue/Queue.java`
- [Segment trees](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree): `src/main/java/com/williamfiset/algorithms/datastructures/segmenttree`
- [Pointer segment tree](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/Node.java): `src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/Node.java`
- [Sum segment tree](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/SumQuerySumUpdateSegmentTree.java): `src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/SumQuerySumUpdateSegmentTree.java`
- [Multiplication updates](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/SumQueryMultiplicationUpdateSegmentTree.java): `src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/SumQueryMultiplicationUpdateSegmentTree.java`
- [Stack interface](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/stack/Stack.java): `src/main/java/com/williamfiset/algorithms/datastructures/stack/Stack.java`
- [Suffix arrays](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/datastructures/suffixarray): `src/main/java/com/williamfiset/algorithms/datastructures/suffixarray`
- [Quad tree](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/datastructures/quadtree/QuadTree.java): `src/main/java/com/williamfiset/algorithms/datastructures/quadtree/QuadTree.java`

### Graph algorithms

- [Graph algorithms](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/graphtheory): `src/main/java/com/williamfiset/algorithms/graphtheory`
- [Prim analysis](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/analysis/PrimsGraphRepresentationAnaylsis.java): `src/main/java/com/williamfiset/algorithms/graphtheory/analysis/PrimsGraphRepresentationAnaylsis.java`
- [Flow solver base](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/NetworkFlowSolverBase.java): `src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/NetworkFlowSolverBase.java`
- [Min-cost flow](https://github.com/williamfiset/algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/MinCostMaxFlowWithBellmanFord.java): `src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/MinCostMaxFlowWithBellmanFord.java`
- [Tree algorithms](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/graphtheory/treealgorithms): `src/main/java/com/williamfiset/algorithms/graphtheory/treealgorithms`

### Optimization

- [Dynamic programming](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/dp): `src/main/java/com/williamfiset/algorithms/dp`
- [Geometry](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/geometry): `src/main/java/com/williamfiset/algorithms/geometry`

### Core computing

- [Linear algebra](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/linearalgebra): `src/main/java/com/williamfiset/algorithms/linearalgebra`
- [Mathematics](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/math): `src/main/java/com/williamfiset/algorithms/math`

### Sequence algorithms

- [Searching](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/search): `src/main/java/com/williamfiset/algorithms/search`
- [Sorting](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/sorting): `src/main/java/com/williamfiset/algorithms/sorting`
- [String algorithms](https://github.com/williamfiset/algorithms/tree/master/src/main/java/com/williamfiset/algorithms/strings): `src/main/java/com/williamfiset/algorithms/strings`

### Other components

- **Programmer**

## Connections

- Programmer → Searching: runs implementation
- Programmer → Binary search tree: uses implementation
- Binary search tree → Traversal order: uses traversal order (evidence: `src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/BinarySearchTree.java`)
- Binary search tree → Queue interface: uses queue (evidence: `src/main/java/com/williamfiset/algorithms/datastructures/binarysearchtree/BinarySearchTree.java`)
- AVL tree → Stack interface: uses stack (evidence: `src/main/java/com/williamfiset/algorithms/datastructures/balancedtree/AVLTreeRecursiveOptimized.java`)
- Fibonacci heap → Queue interface: uses queue (evidence: `src/main/java/com/williamfiset/algorithms/datastructures/fibonacciheap/FibonacciHeap.java`)
- Fibonacci heap → Stack interface: uses stack (evidence: `src/main/java/com/williamfiset/algorithms/datastructures/fibonacciheap/FibonacciHeap.java`)
- Prim analysis → Searching: benchmarks Prim (evidence: `src/main/java/com/williamfiset/algorithms/graphtheory/analysis/PrimsGraphRepresentationAnaylsis.java`)
- Min-cost flow → Flow solver base: extends solver (evidence: `src/main/java/com/williamfiset/algorithms/graphtheory/networkflow/MinCostMaxFlowWithBellmanFord.java`)
- Multiplication updates → Sum segment tree: example constructs (evidence: `src/main/java/com/williamfiset/algorithms/datastructures/segmenttree/SumQueryMultiplicationUpdateSegmentTree.java`)
