# Getting Started

## What This Project Does

`algo_Calc` is a small Java Swing application for demonstrating and running classic sorting algorithms. It gives users a menu of sorting choices, accepts a space-separated list of integers, and displays the sorted result. The project also includes companion text files for each algorithm, which can be opened from the UI as a teaching aid.

## Recommended Reading Order

1. **[Repository overview](.codewiki/overview.md)** — get the big picture first.
2. **[`algo_Calc` module guide](.codewiki/algo_Calc.md)** — learn the main classes and runtime flow.
3. **[`src/algo_Calc/Frame.java`](src/algo_Calc/Frame.java)** — see how the algorithm menu starts the app.
4. **[`src/algo_Calc/Sortingss.java`](src/algo_Calc/Sortingss.java)** — understand input parsing, dispatch, and output rendering.

## Key Entry Points

Start with these classes:

- **[`Frame`](src/algo_Calc/Frame.java)** — the first screen users see; it routes to the selected algorithm.
- **[`Sortingss`](src/algo_Calc/Sortingss.java)** — the main working window where input is sorted and displayed.
- **[`quiks`](src/algo_Calc/Sortingss.java)** — quick sort helper used by `Sortingss`.
- **[`merg`](src/algo_Calc/Sortingss.java)** — merge sort helper used by `Sortingss`.
- **[`heaps`](src/algo_Calc/Sortingss.java)** — heap sort helper used by `Sortingss`.

There are no highly-connected classes beyond these core entry points.

## Project Structure

The repository is intentionally compact:

- **`src/algo_Calc/`** — Java source for the app.
  - `Frame.java` contains the main menu window.
  - `Sortingss.java` contains the sorting window plus the sorting logic.
- **`bin/algo_Calc/`** — compiled class files.
- **`Images/`** — screenshots used by the project README.
- **`*.txt` files at the repo root** — companion algorithm notes opened from the UI.
- **`.codewiki/`** — generated internal documentation pages.

The application is self-contained and uses standard Java/Swing only.

## Configuration

Key files to know:

- **[`.project`](.project)** — Eclipse project metadata.
- **[`.classpath`](.classpath)** — Eclipse classpath configuration.
- **[`.settings/org.eclipse.jdt.core.prefs`](.settings/org.eclipse.jdt.core.prefs)** — Java compiler and formatting preferences.
- **`bubble.txt`, `selection.txt`, `quicksort.txt`, `insertion.txt`, `merge.txt`, `maxheap.txt`** — algorithm reference files opened by the UI.

There does not appear to be an external runtime configuration layer, database config, or environment-based setup.

## Common Patterns

A few patterns show up throughout the codebase:

- **Event-driven Swing UI** — button clicks drive the entire flow.
- **Single-package design** — UI and helper classes live together in `algo_Calc`.
- **Algorithm dispatch by numeric key** — `Frame` passes an integer key into `Sortingss.vis(...)`, and the submit handler chooses the sort based on that key.
- **Absolute-position layouts** — the frames use `null` layouts with hard-coded bounds.
- **Simple string-to-array parsing** — user input is split on spaces, converted to `int[]`, sorted, then rendered back to text.

## How the App Flows

```mermaid
flowchart TD
FrameMain["Frame"] --> SortingssVis["Sortingss.vis()"]
SortingssVis --> SortWindow["Sorting window"]
SortWindow --> ParseInput["Parse integer input"]
ParseInput --> RunSort["Run selected algorithm"]
RunSort --> ShowOutput["Display sorted result"]
```

## What to Read First in the Code

If you only read two source files, read them in this order:

1. **[`src/algo_Calc/Frame.java`](src/algo_Calc/Frame.java)** — shows the available algorithms and how the selection is handed off.
2. **[`src/algo_Calc/Sortingss.java`](src/algo_Calc/Sortingss.java)** — contains the core workflow and the algorithm implementations.

That path will give you enough context to make changes safely without getting lost in the UI code.
