# amnaa-khann/lab-2 architecture

> Architecture diagram of the GitHub repository amnaa-khann/lab-2, 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/amnaa-khann/lab-2
- Repository: https://github.com/amnaa-khann/lab-2

## Overview

This repository is a set of small Java examples about dynamic arrays and `ArrayList`, rather than a cohesive application. The examples demonstrate adding, removing, reading, replacing, searching, iterating, and checking size or initial capacity; `a_example.java` also shows shrinking an array. Each runnable example is an independent `main` program. `a.java` contains incomplete snippets, so it is not mapped as a runnable flow. There is no README, and the graph reflects only the supplied source excerpts.

Main entry points: [`b.java`](https://github.com/amnaa-khann/lab-2/blob/main/b.java) (List operations), [`b_example.java`](https://github.com/amnaa-khann/lab-2/blob/main/b_example.java) (Remove element), [`c.java`](https://github.com/amnaa-khann/lab-2/blob/main/c.java) (Append items), [`d.java`](https://github.com/amnaa-khann/lab-2/blob/main/d.java) (Replace element)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arraylist["ArrayList examples"]
  node_list_basics["List operations<br/>[b.java]"]
  node_list_remove["Remove element<br/>[b_example.java]"]
  node_list_append["Append items<br/>[c.java]"]
  node_list_replace["Replace element<br/>[d.java]"]
  node_list_sum["Sum elements<br/>[e.java]"]
  node_list_capacity["Initial capacity<br/>[f.java]"]
end

subgraph group_arrays["Resizable array example"]
  node_shrink_example["Shrink array<br/>[a_example.java]"]
end

node_launcher(("Java launcher"))
node_java_arraylist["Java ArrayList"]

node_launcher -->|"runs main"| node_list_basics
node_launcher -->|"runs main"| node_list_remove
node_launcher -->|"runs main"| node_list_append
node_launcher -->|"runs main"| node_list_replace
node_launcher -->|"runs main"| node_list_sum
node_launcher -->|"runs main"| node_list_capacity
node_launcher -->|"runs main"| node_shrink_example
node_list_basics -->|"uses"| node_java_arraylist
node_list_remove -->|"uses"| node_java_arraylist
node_list_append -->|"uses"| node_java_arraylist
node_list_replace -->|"uses"| node_java_arraylist
node_list_sum -->|"uses"| node_java_arraylist
node_list_capacity -->|"uses"| node_java_arraylist

click node_list_basics "https://github.com/amnaa-khann/lab-2/blob/main/b.java"
click node_list_remove "https://github.com/amnaa-khann/lab-2/blob/main/b_example.java"
click node_list_append "https://github.com/amnaa-khann/lab-2/blob/main/c.java"
click node_list_replace "https://github.com/amnaa-khann/lab-2/blob/main/d.java"
click node_list_sum "https://github.com/amnaa-khann/lab-2/blob/main/e.java"
click node_list_capacity "https://github.com/amnaa-khann/lab-2/blob/main/f.java"
click node_shrink_example "https://github.com/amnaa-khann/lab-2/blob/main/a_example.java"

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_list_basics,node_list_remove,node_list_append,node_list_replace,node_list_sum,node_list_capacity toneBlue
class node_shrink_example toneAmber
class node_launcher,node_java_arraylist toneIndigo
```

## Components

### ArrayList examples

- [List operations](https://github.com/amnaa-khann/lab-2/blob/main/b.java): `b.java`
- [Remove element](https://github.com/amnaa-khann/lab-2/blob/main/b_example.java): `b_example.java`
- [Append items](https://github.com/amnaa-khann/lab-2/blob/main/c.java): `c.java`
- [Replace element](https://github.com/amnaa-khann/lab-2/blob/main/d.java): `d.java`
- [Sum elements](https://github.com/amnaa-khann/lab-2/blob/main/e.java): `e.java`
- [Initial capacity](https://github.com/amnaa-khann/lab-2/blob/main/f.java): `f.java`

### Resizable array example

- [Shrink array](https://github.com/amnaa-khann/lab-2/blob/main/a_example.java): `a_example.java`

### Other components

- **Java launcher**
- **Java ArrayList**

## Connections

- Java launcher → List operations: runs main
- Java launcher → Remove element: runs main
- Java launcher → Append items: runs main
- Java launcher → Replace element: runs main
- Java launcher → Sum elements: runs main
- Java launcher → Initial capacity: runs main
- Java launcher → Shrink array: runs main
- List operations → Java ArrayList: uses
- Remove element → Java ArrayList: uses
- Append items → Java ArrayList: uses
- Replace element → Java ArrayList: uses
- Sum elements → Java ArrayList: uses
- Initial capacity → Java ArrayList: uses
