# Repository Overview

Welcome to `algo_Calc`, a small Java desktop application centered on sorting algorithms. This repository appears to provide a simple Swing interface where a user can choose a sorting method, enter space-separated integers, and see the sorted output. The code uses standard Java SE libraries rather than a larger framework, so the structure is compact and easy to read. If you are new here, think of it as both a sorting demo and a lightweight UI wrapper around several classic algorithms.

## Overview

This project appears to be a sorting visualizer and algorithm sampler. The flow is straightforward: one window lets the user pick an algorithm, and a second window lets them type a list of numbers, run the sort, and inspect the result. The repository also appears to include text files with example code or notes for each algorithm, which can be opened from the UI.

The application is organized around two GUI classes and several helper classes that implement the sorting logic. Some algorithms are implemented directly in the UI event handler, while others are delegated to separate helper classes. That makes the code easy to follow in one pass, though the responsibilities are somewhat mixed together.

## Technology Stack

- **Language:** Java
- **UI toolkit:** Swing and AWT
- **Process launching:** `ProcessBuilder` for opening algorithm text files in Notepad
- **External frameworks:** none detected

This repository appears to rely only on the Java standard library.

## Architecture

At a high level, the application is a two-window Swing program:

1. `Frame` presents the algorithm chooser.
2. `Sortingss` owns the sorting screen, input parsing, output rendering, and algorithm dispatch.
3. `quiks`, `merg`, and `heaps` hold the more reusable algorithm implementations.

```mermaid
flowchart TD
  FrameClass["Frame"] --> SortingssClass["Sortingss"]
  SortingssClass --> QuiksClass["quiks"]
  SortingssClass --> MergClass["merg"]
  SortingssClass --> HeapsClass["heaps"]
  FrameClass --> MenuButtons["Algorithm selection buttons"]
  MenuButtons --> SortingssClass
```

In practice, `Frame` acts as the launcher and `Sortingss` acts as the main controller/view. The helper classes are only used when the selected algorithm needs them.

## Module Guide

### `algo_Calc`

This appears to be the only top-level module in the repository. It contains the full desktop sorting experience: a launcher window, the main sort window, and the algorithm implementations themselves. The key classes are `Frame`, `Sortingss`, `quiks`, `merg`, and `heaps`.

### `Frame`

`Frame` is the entry window. It creates the algorithm menu with buttons for Bubble Sort, Selection Sort, Quick Sort, Insertion Sort, Merge Sort, and Heap Sort. Each button passes a numeric key and a display label into `Sortingss.vis(...)`, then hides the menu window.

### `Sortingss`

`Sortingss` is the main application window and the central coordinator. It reads the user's input, chooses the algorithm branch based on the selected key, performs or delegates the sort, and displays the result. It also contains the "Open Code" action, which appears to launch Notepad with an algorithm-specific `.txt` file.

### `quiks`

`quiks` contains the quick-sort implementation. It provides a recursive `quickSort(...)` method and a `partition(...)` helper that rearranges the array around a pivot element.

### `merg`

`merg` contains merge-sort logic. It appears to split the input into halves, recursively sort each half, and merge them back together with temporary arrays.

### `heaps`

`heaps` contains the heap-sort implementation. It appears to build a max heap with `heapify(...)`, then repeatedly move the largest element to the end of the array until the full list is sorted.

## Getting Started

If you are reading the code for the first time, start here:

1. **`src/algo_Calc/Frame.java`** — read this first to understand the UI entry point and how algorithm selection is forwarded.
2. **`src/algo_Calc/Sortingss.java`** — then read the main window class, especially the `vis(...)` method and the Submit button handler.
3. **`quiks`, `merg`, and `heaps` inside `Sortingss.java`** — these classes show the reusable sorting implementations.

A practical reading order is:

- `Frame.main(...)` to see how the app starts
- `Frame.initialize()` to see the algorithm menu
- `Sortingss.vis(...)` to understand how the chosen algorithm is stored
- `Sortingss.initialize()` to follow the input and output flow
- `quiks.quickSort(...)`, `merg.mergeSort(...)`, and `heaps.heapSort(...)` for the algorithm details

If you plan to extend the project, the best next step is to trace the `key` values used in `Frame` and the Submit button handler in `Sortingss`, since that is where new algorithms would be wired in.