# theraiven/datastructures architecture

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

- Interactive diagram: https://gitdiagram.com/theraiven/datastructures
- Repository: https://github.com/theraiven/datastructures

## Overview

This is an educational C++ data-structures library. Its principal workflow is a caller choosing a container, performing operations such as insertion, lookup, or iteration, and using the resulting stored data; the README also documents a runnable comparison of the custom containers with STL equivalents. The graph includes the documented container families and useful iterator/node layers. Several implementations were not sampled, so their internal call relationships are omitted or marked unverified rather than inferred.

Main entry points: [`DataStructures/Benchmark/BenchmarkDSAndSTL.h`](https://github.com/theraiven/datastructures/blob/master/DataStructures/Benchmark/BenchmarkDSAndSTL.h) (Container comparisons), [`DataStructures/Containers/Vector/Vector.h`](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/Vector/Vector.h) (Vector), [`DataStructures/Containers/HashMap/HashMapChaining/HashMapChaining.h`](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapChaining/HashMapChaining.h) (Chaining map), [`DataStructures/Containers/HashMap/HashMapOpenAddressing/HashMapOpenAddressing.h`](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapOpenAddressing/HashMapOpenAddressing.h) (Open-addressing map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_containers["Core containers"]
  node_vector["Vector<br/>[Vector.h]"]
  node_list["List<br/>[List.h]"]
  node_rbtree["Red-black tree<br/>[RBTree.h]"]
end

subgraph group_hashing["Hash tables"]
  node_hash_interface["Hash table interface<br/>[IHashTable.h]"]
  node_chaining["Chaining map<br/>[HashMapChaining.h]"]
  node_open_addressing["Open-addressing map"]
end

subgraph group_internals["Iterator and node internals"]
  node_vector_iter["Vector iterators<br/>[VectorIterators.h]"]
  node_list_iter["List iterators<br/>[ListIterator.h]"]
  node_list_node["List node<br/>[ListNode.h]"]
  node_tree_iter["Tree iterators<br/>[RBTIterators.h]"]
  node_tree_node["Tree node<br/>[RBTNode.h]"]
  node_hash_iter["Hash iterators"]
end

subgraph group_benchmark["Performance comparison"]
  node_main["Benchmark entry point<br/>[DataStructures.cpp]"]
  node_benchmarks["Container comparisons"]
end

node_caller(("Library caller"))
node_stl["STL equivalents"]

node_caller -->|"uses"| node_vector
node_caller -->|"uses"| node_list
node_caller -->|"uses"| node_rbtree
node_caller -->|"uses"| node_chaining
node_caller -->|"uses"| node_open_addressing
node_vector -->|"uses"| node_vector_iter
node_list_iter -->|"reads links"| node_list_node
node_tree_iter -->|"traverses"| node_tree_node
node_hash_iter -->|"references"| node_hash_interface
node_open_addressing -->|"implements"| node_hash_interface
node_chaining -.->|"implements"| node_hash_interface
node_caller -->|"runs"| node_main
node_main -->|"runs comparisons"| node_benchmarks
node_benchmarks -->|"compares against"| node_stl
node_benchmarks -.->|"measures"| node_vector
node_benchmarks -.->|"measures"| node_list
node_benchmarks -.->|"measures"| node_rbtree
node_benchmarks -.->|"measures"| node_chaining
node_benchmarks -.->|"measures"| node_open_addressing

click node_vector "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/Vector/Vector.h"
click node_list "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/List/List.h"
click node_rbtree "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/RBTree/RBTree.h"
click node_vector_iter "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/Vector/VectorIterators.h"
click node_list_iter "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/List/ListIterator.h"
click node_list_node "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/List/ListNode.h"
click node_tree_iter "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/RBTree/RBTIterators.h"
click node_tree_node "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/RBTree/RBTNode.h"
click node_hash_interface "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/IHashTable.h"
click node_chaining "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapChaining/HashMapChaining.h"
click node_open_addressing "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapOpenAddressing/HashMapOpenAddressing.h"
click node_hash_iter "https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapChaining/HashTableIterator.h"
click node_main "https://github.com/theraiven/datastructures/blob/master/DataStructures/DataStructures.cpp"
click node_benchmarks "https://github.com/theraiven/datastructures/blob/master/DataStructures/Benchmark/BenchmarkDSAndSTL.h"

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_vector,node_list,node_rbtree toneBlue
class node_hash_interface,node_chaining,node_open_addressing toneAmber
class node_vector_iter,node_list_iter,node_list_node,node_tree_iter,node_tree_node,node_hash_iter toneMint
class node_main,node_benchmarks toneRose
class node_caller,node_stl toneIndigo
```

## Components

### Core containers

- [Vector](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/Vector/Vector.h): `DataStructures/Containers/Vector/Vector.h`
- [List](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/List/List.h): `DataStructures/Containers/List/List.h`
- [Red-black tree](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/RBTree/RBTree.h): `DataStructures/Containers/RBTree/RBTree.h`

### Hash tables

- [Hash table interface](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/IHashTable.h): `DataStructures/Containers/HashMap/IHashTable.h`
- [Chaining map](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapChaining/HashMapChaining.h): `DataStructures/Containers/HashMap/HashMapChaining/HashMapChaining.h`
- [Open-addressing map](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapOpenAddressing/HashMapOpenAddressing.h): `DataStructures/Containers/HashMap/HashMapOpenAddressing/HashMapOpenAddressing.h`

### Iterator and node internals

- [Vector iterators](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/Vector/VectorIterators.h): `DataStructures/Containers/Vector/VectorIterators.h`
- [List iterators](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/List/ListIterator.h): `DataStructures/Containers/List/ListIterator.h`
- [List node](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/List/ListNode.h): `DataStructures/Containers/List/ListNode.h`
- [Tree iterators](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/RBTree/RBTIterators.h): `DataStructures/Containers/RBTree/RBTIterators.h`
- [Tree node](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/RBTree/RBTNode.h): `DataStructures/Containers/RBTree/RBTNode.h`
- [Hash iterators](https://github.com/theraiven/datastructures/blob/master/DataStructures/Containers/HashMap/HashMapChaining/HashTableIterator.h): `DataStructures/Containers/HashMap/HashMapChaining/HashTableIterator.h`

### Performance comparison

- [Benchmark entry point](https://github.com/theraiven/datastructures/blob/master/DataStructures/DataStructures.cpp): `DataStructures/DataStructures.cpp`
- [Container comparisons](https://github.com/theraiven/datastructures/blob/master/DataStructures/Benchmark/BenchmarkDSAndSTL.h): `DataStructures/Benchmark/BenchmarkDSAndSTL.h`

### Other components

- **Library caller**
- **STL equivalents**

## Connections

- Library caller → Vector: uses (evidence: `README.md`)
- Library caller → List: uses (evidence: `README.md`)
- Library caller → Red-black tree: uses (evidence: `README.md`)
- Library caller → Chaining map: uses (evidence: `README.md`)
- Library caller → Open-addressing map: uses (evidence: `README.md`)
- Vector → Vector iterators: uses (evidence: `DataStructures/Containers/Vector/Vector.h`)
- List iterators → List node: reads links (evidence: `DataStructures/Containers/List/ListIterator.h`)
- Tree iterators → Tree node: traverses (evidence: `DataStructures/Containers/RBTree/RBTIterators.h`)
- Hash iterators → Hash table interface: references (evidence: `DataStructures/Containers/HashMap/HashMapChaining/HashTableIterator.h`)
- Open-addressing map → Hash table interface: implements (evidence: `DataStructures/Containers/HashMap/HashMapOpenAddressing/HashMapOpenAddressing.h`)
- Chaining map → Hash table interface: implements
- Library caller → Benchmark entry point: runs (evidence: `README.md`)
- Benchmark entry point → Container comparisons: runs comparisons (evidence: `DataStructures/DataStructures.cpp`)
- Container comparisons → STL equivalents: compares against (evidence: `README.md`)
- Container comparisons → Vector: measures
- Container comparisons → List: measures
- Container comparisons → Red-black tree: measures
- Container comparisons → Chaining map: measures
- Container comparisons → Open-addressing map: measures
