# Repository Overview

Welcome! This repository appears to be a small Java desktop application centered on classic sorting algorithms and a simple Swing user interface. It gives the user a menu of sorting choices, accepts space-separated integers, and then displays the sorted output. The code is organized into one UI entry screen and one main sorting window, with helper classes for several algorithms. Overall, this looks like a teaching or demo project for comparing sorting techniques.

## Overview

This project appears to be a sorting visualizer/demo that lets a user choose one of several algorithms and run it against a list of integers entered at runtime. The workflow is intentionally straightforward: pick an algorithm, type numbers into a text field, submit, and read back the sorted result. It also includes an "Open Code" action that launches a text file tied to the selected algorithm, which suggests the repository is meant to pair the UI with readable algorithm examples.

The main user experience is split across two windows:

- `Frame` acts as the menu screen where the algorithm is chosen.
- `Sortingss` acts as the main working window where input is entered and output is shown.

## Technology Stack

The detected stack is lightweight and uses only standard Java desktop APIs:

- **Java** — the application code is written in Java.
- **Swing** — used for windows, buttons, labels, text fields, and text areas.
- **AWT** — used for event dispatching and basic UI classes such as `EventQueue`, `Font`, and `Color`.
- **ProcessBuilder** — used to launch Notepad for the algorithm-specific text files.

No third-party frameworks or external libraries were detected from the available files.

## Architecture

At a high level, this repository appears to follow a simple two-layer structure: a UI layer that handles user interaction, and an algorithm layer that performs sorting. The menu window hands the selected algorithm to the main sorter window, which then dispatches to either inline sorting code or helper classes.

```mermaid
flowchart LR
  FrameClass["Frame"] --> SortingssClass["Sortingss"]
  SortingssClass --> QuiksClass["quiks"]
  SortingssClass --> MergClass["merg"]
  SortingssClass --> HeapsClass["heaps"]
  FrameClass --> MenuButtons["Sort selection buttons"]
  MenuButtons --> SortingssClass
  SortingssClass --> InputParsing["Parse space separated integers"]
  InputParsing --> Algorithms["Selected sorting algorithm"]
```

In practice, the architecture looks like this:

1. The user opens `Frame` and chooses a sort.
2. The selected choice is stored in `Sortingss` via `vis(...)`.
3. The user enters numbers in the main window.
4. `Sortingss` parses the input and runs the chosen algorithm.
5. The sorted result is rendered back into the UI.

## Module Guide

### `algo_Calc`

This appears to be the only top-level module in the repository and contains the full application. It includes the UI entry point, the main sorting window, and helper classes for a few algorithms. The key classes are:

- **`Frame`** — the initial menu window that lets the user choose Bubble Sort, Selection Sort, Quick Sort, Insertion Sort, Merge Sort, or Max Heap Sort.
- **`Sortingss`** — the primary application window that accepts input, runs the selected sort, formats the output, and can open an algorithm-specific text file.
- **`quiks`** — helper class for quick sort.
- **`merg`** — helper class for merge sort.
- **`heaps`** — helper class for heap sort.

The module is small, but it combines both user interface logic and algorithm implementations in one package. That makes it easy to follow for a beginner, though it also means the event handler in `Sortingss` does a lot of work.

## Getting Started

If you are new to this codebase, start with the UI flow and then move into the algorithm helpers:

1. **Read `Frame` first** — this is the entry point and shows how the algorithm choice is passed forward.
2. **Read `Sortingss` next** — this is the main screen, and its submit handler is where input parsing and algorithm dispatch happen.
3. **Then inspect the algorithm helpers** — `quiks`, `merg`, and `heaps` each implement one sorting strategy.
4. **Finally, trace the `Open Code` behavior** — this reveals how the app maps each algorithm choice to a local text file.

A good reading order is:

- `src/algo_Calc/Frame.java`
- `src/algo_Calc/Sortingss.java` (especially the `vis(...)` method and the Submit button handler)
- the helper classes inside `Sortingss.java`: `quiks`, `merg`, and `heaps`

### Entry points and key references

- Main menu entry: [`Frame.main`](src/algo_Calc/Frame.java:16)
- Main sorter entry: [`Sortingss.main`](src/algo_Calc/Sortingss.java:171)
- Algorithm handoff: [`Sortingss.vis(...)`](src/algo_Calc/Sortingss.java:190)
- Quick sort helper: [`quiks.quickSort(...)`](src/algo_Calc/Sortingss.java:19)
- Merge sort helper: [`merg.mergeSort(...)`](src/algo_Calc/Sortingss.java:105)
- Heap sort helper: [`heaps.heapSort(...)`](src/algo_Calc/Sortingss.java:144)

## Notes for New Developers

- Input is expected to be **space-separated integers**.
- The UI uses **Windows Notepad** for the "Open Code" feature, so that behavior is platform-specific.
- Some algorithms are implemented inline in the submit handler, while others are delegated to helper classes.
- The class names `quiks`, `merg`, and `heaps` are intentionally minimal and may look unusual at first glance.

If you are extending the repository, a natural first improvement would be to move all sorting logic into dedicated classes so the UI handler becomes easier to read and maintain.