# vikas84214/dsa_program architecture

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

- Interactive diagram: https://gitdiagram.com/vikas84214/dsa_program
- Repository: https://github.com/vikas84214/dsa_program

## Overview

This repository is a collection of standalone Java array examples, not a connected application. The principal workflow is to run a class’s `main` method, which exercises an array operation or algorithm and prints a result. The examples cover array initialization, searching, reversal, pair and subarray enumeration, maximum values and sums, stock profit, and trapped rainwater. Source excerpts show the behavior of most classes; there is no README or shared orchestration, and the graph treats each example as an independent entry point.

Main entry points: [`ArraysIntro.java`](https://github.com/vikas84214/dsa_program/blob/main/ArraysIntro.java) (Array initialization), [`BinarySearch.java`](https://github.com/vikas84214/dsa_program/blob/main/BinarySearch.java) (Binary search), [`ReverseArray.java`](https://github.com/vikas84214/dsa_program/blob/main/ReverseArray.java) (Reverse array), [`PairsinArray.java`](https://github.com/vikas84214/dsa_program/blob/main/PairsinArray.java) (Array pairs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_examples["Array examples"]
  node_arrays_intro["Array initialization<br/>[ArraysIntro.java]"]
  node_binary_search["Binary search<br/>[BinarySearch.java]"]
  node_reverse_array["Reverse array<br/>[ReverseArray.java]"]
  node_pairs_array["Array pairs<br/>[PairsinArray.java]"]
  node_print_subarrays["Print subarrays"]
  node_largest_number["Largest number<br/>[LargestNumber.java]"]
  node_max_subarray["Maximum subarray sum"]
  node_stock_profit["Stock profit"]
  node_arrays_cc["Stock profit variant<br/>[ArraysCC.java]"]
  node_rainwater["Trapped rainwater"]
end

node_user(("Engineer"))
node_console["Console"]

node_user -->|"runs main"| node_arrays_intro
node_user -->|"runs main"| node_binary_search
node_user -->|"runs main"| node_reverse_array
node_user -->|"runs main"| node_pairs_array
node_user -->|"runs main"| node_print_subarrays
node_user -->|"runs main"| node_largest_number
node_user -->|"runs main"| node_max_subarray
node_user -->|"runs main"| node_stock_profit
node_user -->|"runs main"| node_arrays_cc
node_user -->|"runs main"| node_rainwater
node_arrays_intro -->|"prints values"| node_console
node_binary_search -->|"prints index"| node_console
node_reverse_array -->|"prints arrays"| node_console
node_pairs_array -->|"prints pairs"| node_console
node_print_subarrays -->|"prints subarrays"| node_console
node_largest_number -->|"prints maximum"| node_console
node_max_subarray -->|"prints sums"| node_console
node_stock_profit -->|"prints profit"| node_console
node_arrays_cc -->|"prints profit"| node_console
node_rainwater -->|"prints water"| node_console

click node_arrays_intro "https://github.com/vikas84214/dsa_program/blob/main/ArraysIntro.java"
click node_binary_search "https://github.com/vikas84214/dsa_program/blob/main/BinarySearch.java"
click node_reverse_array "https://github.com/vikas84214/dsa_program/blob/main/ReverseArray.java"
click node_pairs_array "https://github.com/vikas84214/dsa_program/blob/main/PairsinArray.java"
click node_print_subarrays "https://github.com/vikas84214/dsa_program/blob/main/PrintSubarrays.java"
click node_largest_number "https://github.com/vikas84214/dsa_program/blob/main/LargestNumber.java"
click node_max_subarray "https://github.com/vikas84214/dsa_program/blob/main/MaxSubarraySum.java"
click node_stock_profit "https://github.com/vikas84214/dsa_program/blob/main/BuyAndSellStock.java"
click node_arrays_cc "https://github.com/vikas84214/dsa_program/blob/main/ArraysCC.java"
click node_rainwater "https://github.com/vikas84214/dsa_program/blob/main/TrappingRainWater.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_arrays_intro,node_binary_search,node_reverse_array,node_pairs_array,node_print_subarrays,node_largest_number,node_max_subarray,node_stock_profit,node_arrays_cc,node_rainwater toneBlue
class node_user,node_console toneIndigo
```

## Components

### Array examples

- [Array initialization](https://github.com/vikas84214/dsa_program/blob/main/ArraysIntro.java): `ArraysIntro.java`
- [Binary search](https://github.com/vikas84214/dsa_program/blob/main/BinarySearch.java): `BinarySearch.java`
- [Reverse array](https://github.com/vikas84214/dsa_program/blob/main/ReverseArray.java): `ReverseArray.java`
- [Array pairs](https://github.com/vikas84214/dsa_program/blob/main/PairsinArray.java): `PairsinArray.java`
- [Print subarrays](https://github.com/vikas84214/dsa_program/blob/main/PrintSubarrays.java): `PrintSubarrays.java`
- [Largest number](https://github.com/vikas84214/dsa_program/blob/main/LargestNumber.java): `LargestNumber.java`
- [Maximum subarray sum](https://github.com/vikas84214/dsa_program/blob/main/MaxSubarraySum.java): `MaxSubarraySum.java`
- [Stock profit](https://github.com/vikas84214/dsa_program/blob/main/BuyAndSellStock.java): `BuyAndSellStock.java`
- [Stock profit variant](https://github.com/vikas84214/dsa_program/blob/main/ArraysCC.java): `ArraysCC.java`
- [Trapped rainwater](https://github.com/vikas84214/dsa_program/blob/main/TrappingRainWater.java): `TrappingRainWater.java`

### Other components

- **Engineer**
- **Console**

## Connections

- Engineer → Array initialization: runs main
- Engineer → Binary search: runs main
- Engineer → Reverse array: runs main
- Engineer → Array pairs: runs main
- Engineer → Print subarrays: runs main
- Engineer → Largest number: runs main
- Engineer → Maximum subarray sum: runs main
- Engineer → Stock profit: runs main
- Engineer → Stock profit variant: runs main
- Engineer → Trapped rainwater: runs main
- Array initialization → Console: prints values
- Binary search → Console: prints index
- Reverse array → Console: prints arrays
- Array pairs → Console: prints pairs
- Print subarrays → Console: prints subarrays
- Largest number → Console: prints maximum
- Maximum subarray sum → Console: prints sums
- Stock profit → Console: prints profit
- Stock profit variant → Console: prints profit
- Trapped rainwater → Console: prints water
