# Getting Started

## What This Project Does

`algo_Calc` is a small Java Swing application for comparing classic sorting algorithms. It gives users a menu of algorithms, accepts a space-separated list of integers, sorts the values, and shows the result in a second window. It also includes text-file shortcuts for reading example code for each algorithm.

## Recommended Reading Order

1. **[`overview.md`](../overview.md)** — start here for the big-picture summary of the repository.
2. **[`algo_Calc.md`](../algo_Calc.md)** — then read the module page for the class-by-class breakdown.
3. **[`src/algo_Calc/Frame.java`](../../src/algo_Calc/Frame.java)** and **[`src/algo_Calc/Sortingss.java`](../../src/algo_Calc/Sortingss.java)** — finish by tracing the actual UI flow and sorting logic.

## Key Entry Points

The most important classes to understand first are:

- **[`Frame`](../../src/algo_Calc/Frame.java)** — the launcher window and algorithm picker.
- **[`Sortingss`](../../src/algo_Calc/Sortingss.java)** — the main sorting window and application controller.
- **[`quiks`](../../src/algo_Calc/Sortingss.java)** — quick sort implementation.
- **[`merg`](../../src/algo_Calc/Sortingss.java)** — merge sort implementation.
- **[`heaps`](../../src/algo_Calc/Sortingss.java)** — heap sort implementation.

A useful mental model is: `Frame` chooses the algorithm, `Sortingss` handles input/output, and the helper classes do the recursive sorts.

## Project Structure

The codebase is intentionally small and centered in one Java package:

- **`src/algo_Calc/Frame.java`** — first window, algorithm buttons, navigation into the sorter.
- **`src/algo_Calc/Sortingss.java`** — main UI, parsing, dispatch, and most of the sorting code.
- **`bin/algo_Calc/`** — compiled class files.
- **`*.txt` files at the repository root** — algorithm notes or sample code opened from the UI.
- **`Images/`** — screenshots used in the project documentation.
- **`.codewiki/`** — generated documentation pages for this repository.

There are no submodules or deeper packages; everything important lives in the `algo_Calc` package.

## Configuration

The main configuration files are simple Java/Eclipse project metadata:

- **[`.project`](../.project)** — Eclipse project definition.
- **[`.classpath`](../.classpath)** — classpath configuration for the Java project.
- **[`.settings/org.eclipse.jdt.core.prefs`](../.settings/org.eclipse.jdt.core.prefs)** — Java compiler and formatting preferences.

Runtime behavior is mostly controlled in code rather than config files. The sort selection is driven by the integer `key` passed from `Frame` into `Sortingss`, and the **Open Code** button uses hard-coded text file names such as `bubble.txt`, `merge.txt`, and `maxheap.txt`.

## Common Patterns

A few patterns show up throughout the codebase:

- **Event-driven Swing UI** — buttons register `ActionListener`s and update UI state in response to clicks.
- **Window handoff by key** — `Frame` calls `Sortingss.vis(key, title)` to pass the selected algorithm into the next screen.
- **In-place sorting** — the algorithms work directly on `int[]` arrays rather than creating richer data objects.
- **Absolute positioning** — the UI uses `setLayout(null)` and fixed bounds instead of a layout manager.
- **Mixed UI and algorithm logic** — bubble, selection, and insertion sort are implemented inline in the submit handler, while quick, merge, and heap sort live in helper classes.

## How to Read the Code First

If you are trying to understand the app quickly, follow this path:

1. Open **[`Frame.java`](../../src/algo_Calc/Frame.java)** and trace one button click.
2. Jump to **[`Sortingss.java`](../../src/algo_Calc/Sortingss.java)** and follow `vis(...)` into the main window.
3. Read the submit-button logic to see how input parsing and algorithm dispatch work.
4. Inspect `quiks`, `merg`, and `heaps` to understand the reusable sorting implementations.

If you want to change the application, the two places you will most likely edit first are the menu buttons in `Frame` and the `key`-based dispatch in `Sortingss`.