# (DD01) Module: algo_Calc — Detailed Design [2700 LOC]

## Module Overview

The `algo_Calc` module is a small Swing-based sorting demonstrator. It provides a launcher window for selecting one of several classic sorting algorithms and a second window where the user enters a space-separated list of integers, runs the selected algorithm, and views the sorted output.

The module is organized around five classes:
- `Frame` acts as the algorithm picker.
- `Sortingss` owns the main input/output UI and dispatch logic.
- `quiks`, `merg`, and `heaps` implement the nontrivial sorting algorithms used by the UI.

The module has a strong presentation-layer focus. There is no database, service layer, or persistence mechanism beyond opening text files with example source code. Most dependencies are intra-module method calls plus standard Swing and AWT APIs.

### High-Level Processing Flow
```mermaid
flowchart TD
A["User selects algorithm"] --> B["Frame maps button to Sortingss.vis"]
B --> C["Sortingss reads space separated integers"]
C --> D["Dispatch by key"]
D --> E["Bubble sort branch"]
D --> F["Selection sort branch"]
D --> G["Quick sort branch"]
D --> H["Insertion sort branch"]
D --> I["Merge sort branch"]
D --> J["Heap sort branch"]
E --> K["Render result text"]
F --> K
G --> K
H --> K
I --> K
J --> K
```

---

## Class: Frame

### Class Summary

| Field | Value |
|-------|-------|
| FQN | `algo_Calc.Frame` |
| Layer | Presentation / launcher |
| Methods | 12 |

`Frame` is the initial menu window. It presents buttons for each supported sorting algorithm and forwards the selection to `Sortingss` by setting a numeric key and a display label. The class contains no sorting logic; its responsibility is limited to navigation and window visibility control.

### Method: main(String[] args)

#### 1. Role
`main` starts the Swing event dispatch flow and opens the launcher window. It is the application entry point for the module when users begin from the algorithm-selection screen.

#### 2. Processing Pattern
```mermaid
flowchart TD
A["main starts"] --> B["Schedule UI creation on EventQueue"]
B --> C["Instantiate Frame"]
C --> D["Call initialize"]
D --> E["Show launcher window"]
```

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `args` | `String[]` | Standard Java command-line arguments | Not used |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `EventQueue.invokeLater` | C | Defers UI creation to the Swing event thread |
| `new Frame()` | C | Creates the launcher UI |
| `frame.setVisible(true)` | U | Displays the launcher window |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| JVM | `main(String[] args)` | Application startup |

#### 6. Per-Branch Detail Blocks
- Branch A: Schedule the UI work
  - Sub-branch A1: Create a `Runnable` that owns window creation.
  - Sub-branch A2: Handle startup exceptions by printing the stack trace.
- Branch B: Show the window
  - Sub-branch B1: Build the frame through the constructor.
  - Sub-branch B2: Make the frame visible after initialization.

### Method: initialize()

#### 1. Role
`initialize` builds the algorithm-selection UI, including the buttons for bubble, selection, insertion, merge, quick, and heap sorting. Each button stores the selected key and hides the menu so the user can proceed to the main input screen.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| None | — | Frame construction only | No parameters |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `new JFrame()` | C | Creates the launcher window |
| `setBounds`, `setDefaultCloseOperation`, `getContentPane().setLayout` | U | Configures the Swing frame |
| `new JButton(...)` | C | Creates algorithm buttons |
| `ActionListener` callbacks | C/U | Forward algorithm choice to `Sortingss.vis` |
| `Sortingss.vis(...)` | U | Propagates the algorithm selection |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `Frame()` | Constructor | UI bootstrap |
| `main(String[] args)` | App entry | Indirect caller through constructor |

#### 6. Per-Branch Detail Blocks
- Branch A: Window setup
  - Sub-branch A1: Create the frame and fixed-size layout.
  - Sub-branch A2: Add buttons for each supported algorithm.
- Branch B: Button actions
  - Sub-branch B1: Bubble, insertion, selection, merge, quick, and heap buttons all forward to the same target UI.
  - Sub-branch B2: Each action hides the launcher window after dispatch.

### Method: Frame()

#### 1. Role
The constructor creates the launcher instance and delegates immediately to `initialize`. This keeps construction simple and ensures the UI is ready as soon as the object is created.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| None | — | Object construction | No parameters |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `initialize()` | C | Builds the UI |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `main(String[] args)` | Startup | Indirectly constructs the launcher |
| `Frame.initialize()` | Internal | N/A |

#### 6. Per-Branch Detail Blocks
- Single path: initialize the frame on construction.

### Method: vis(int k, String str)

#### 1. Role
`vis` records the selected algorithm identifier and display text, then brings the sorting window to the front. It acts as the bridge between the launcher screen and the main input/output screen.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `k` | `int` | Selected algorithm key | Controls sorting branch in `Sortingss` |
| `str` | `String` | Visible algorithm title | Written into the header label |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| Field `key` | U | Stores the selected algorithm key |
| Field `tname` | U | Stores the selected algorithm title |
| `frame.setVisible(true)` | U | Shows the sorting UI |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| Button listeners in `initialize()` | UI event handlers | One listener per algorithm button |

#### 6. Per-Branch Detail Blocks
- Branch A: Store key and title
  - Sub-branch A1: Set `key` to the algorithm code.
  - Sub-branch A2: Overwrite the title string with the selected label.
- Branch B: Show the UI
  - Sub-branch B1: Make the current frame visible.

---

## Class: Sortingss

### Class Summary

| Field | Value |
|-------|-------|
| FQN | `algo_Calc.Sortingss` |
| Layer | Presentation / orchestrator |
| Methods | 18 |

`Sortingss` is the core UI and dispatch class. It owns the input form, reads user-entered integers, selects the active algorithm based on `key`, performs bubble, selection, insertion, quick, merge, or heap sorting, and renders the formatted result back to the screen. It also provides an "Open Code" action that opens the corresponding text file for the selected algorithm.

### Method: main(String[] args)

#### 1. Role
`main` starts the primary sorting window on the Swing event dispatch thread. This is the entry point used when the application launches directly into the calculator/sorting screen instead of the algorithm picker.

#### 2. Processing Pattern
```mermaid
flowchart TD
A["main starts"] --> B["Schedule Sortingss creation"]
B --> C["Instantiate Sortingss"]
C --> D["Constructor calls initialize"]
D --> E["Show main sorting frame"]
```

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `args` | `String[]` | Standard Java command-line arguments | Not used |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `EventQueue.invokeLater` | C | Schedules UI creation |
| `new Sortingss()` | C | Creates the main UI |
| `frame.setVisible(true)` | U | Displays the window |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| JVM | `main(String[] args)` | Application startup |

#### 6. Per-Branch Detail Blocks
- Branch A: UI scheduling
  - Sub-branch A1: Create a `Runnable` wrapper.
  - Sub-branch A2: Catch and log startup exceptions.
- Branch B: Frame display
  - Sub-branch B1: Build and show the main UI.

### Method: Sortingss()

#### 1. Role
The constructor creates the main window immediately. It is a thin wrapper around `initialize`, ensuring that all components are assembled during object creation.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| None | — | Object construction | No parameters |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `initialize()` | C | Builds the UI |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `main(String[] args)` | Startup | Direct constructor call |
| `Frame.vis(...)` | Navigation | Creates or reuses the target window state |

#### 6. Per-Branch Detail Blocks
- Single path: invoke `initialize`.

### Method: vis(int k, String str)

#### 1. Role
`vis` stores the selected algorithm identifier and the visible title for the main screen. It also ensures the sorting frame is visible when the user returns from the algorithm-selection menu.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `k` | `int` | Sorting algorithm selector | Drives the dispatch logic in the submit handler |
| `str` | `String` | Screen title | Displayed in the top text area |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| Field `key` | U | Stores the active algorithm key |
| Field `tname` | U | Stores the displayed algorithm name |
| `frame.setVisible(true)` | U | Shows the main UI |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `Frame.initialize()` button listeners | UI event handlers | One call per algorithm choice |

#### 6. Per-Branch Detail Blocks
- Branch A: State capture
  - Sub-branch A1: Save the numeric key.
  - Sub-branch A2: Replace the title text with the passed label.
- Branch B: Window activation
  - Sub-branch B1: Make the frame visible.

### Method: initialize()

#### 1. Role
`initialize` constructs the main sorting screen. It sets up the input field, output area, submit button, exit button, and open-code button. Its submit handler parses integers, routes execution to the selected sorting algorithm, and formats the final sorted list for display.

#### 2. Processing Pattern
```mermaid
flowchart TD
A["Initialize sorting frame"] --> B["Build labels, input, and buttons"]
B --> C["User clicks Submit"]
C --> D["Read text field and split input"]
D --> E["Parse integers"]
E --> F{"key value"}
F --> G["Bubble sort"]
F --> H["Selection sort"]
F --> I["Quick sort"]
F --> J["Insertion sort"]
F --> K["Merge sort"]
F --> L["Heap sort"]
G --> M["Format output"]
H --> M
I --> M
J --> M
K --> M
L --> M
M --> N["Render title and result"]
```

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| None | — | UI initialization only | No parameters |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `new JFrame()` | C | Creates the main window |
| `JTextArea`, `JTextField`, `JButton`, `JLabel` | C | Constructs UI controls |
| `textField.getText()` | R | Reads user input |
| `String.split(" ")` | C | Tokenizes the entered numbers |
| `Integer.parseInt(...)` | R | Converts tokens to integers |
| Bubble, selection, insertion logic | U | Sorts the local array in place |
| `quiks.quickSort(...)` | U | Quick sort implementation |
| `merg.mergeSort(...)` | U | Merge sort implementation |
| `heaps.heapSort(...)` | U | Heap sort implementation |
| `textArea.setText(...)`, `textArea_1.setText(...)` | U | Displays output |
| `ProcessBuilder(...).start()` | C | Opens the reference text file |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `Sortingss()` | Constructor | Builds UI immediately |
| `vis(int, String)` | Navigation path | Frame may already exist when shown |
| Submit button listener | UI event handler | Main algorithm dispatch entry point |
| Open Code button listener | UI event handler | Opens algorithm source notes |

#### 6. Per-Branch Detail Blocks
- Branch A: Input parsing
  - Sub-branch A1: Split the input string by spaces.
  - Sub-branch A2: Allocate an integer array and parse each token.
- Branch B: Algorithm dispatch
  - Sub-branch B1: `key == 1` runs bubble sort with repeated passes until stable.
  - Sub-branch B2: `key == 2` runs selection sort by repeatedly choosing the minimum.
  - Sub-branch B3: `key == 3` delegates to `quiks.quickSort`.
  - Sub-branch B4: `key == 4` runs insertion sort by shifting larger values right.
  - Sub-branch B5: `key == 5` delegates to `merg.mergeSort`.
  - Sub-branch B6: `key == 6` delegates to `heaps.heapSort`.
- Branch C: Output formatting
  - Sub-branch C1: Convert integers back to strings.
  - Sub-branch C2: Build a human-readable result prefix.
  - Sub-branch C3: Write the output to the result area and header label.
- Branch D: Open code file
  - Sub-branch D1: Select the matching `.txt` file based on the key.
  - Sub-branch D2: Start Notepad with the file path.

#### Method Notes for the Short Branches
- `initialize` contains several event-handler subroutines with one major branch each. The most important behavior is the submit handler, because it coordinates parsing, algorithm selection, and result rendering.

---

## Class: quiks

### Class Summary

| Field | Value |
|-------|-------|
| FQN | `algo_Calc.quiks` |
| Layer | Algorithm / utility |
| Methods | 12 |

`quiks` implements quick sort using the last element as the pivot. It provides the recursive sort driver and the partition routine that rearranges elements in place.

### Method: quickSort(int[] num, int start, int end)

#### 1. Role
This method recursively sorts a segment of the integer array in ascending order. It partitions the segment around a pivot and then sorts the two resulting subsegments.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `num` | `int[]` | Array to sort | Modified in place |
| `start` | `int` | Lower bound of segment | Inclusive |
| `end` | `int` | Upper bound of segment | Inclusive |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `partition(...)` | U | Places pivot and returns its final index |
| Recursive `quickSort(...)` | U | Sorts left and right partitions |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `Sortingss.initialize()` submit handler | Main UI path | Invoked when `key == 3` |

#### 6. Per-Branch Detail Blocks
- Branch A: Partition the range
  - Sub-branch A1: Compute a pivot position with `partition`.
- Branch B: Recurse on the left side
  - Sub-branch B1: Sort only when the left segment has at least two elements.
- Branch C: Recurse on the right side
  - Sub-branch C1: Sort only when the right segment has at least two elements.

### Method: partition(int[] num, int start, int end)

#### 1. Role
`partition` chooses the last element as the pivot and rearranges the array so that all smaller values appear before it. It returns the pivot's final index, which is then used by `quickSort` to split recursion.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `num` | `int[]` | Array being partitioned | Modified in place |
| `start` | `int` | Lower bound of the segment | Updated internally while scanning |
| `end` | `int` | Upper bound of the segment | Pivot index |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| Array swaps | U | Reorders values around the pivot |
| Return value | R | Supplies pivot index to caller |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `quickSort(...)` | Recursive driver | Always called before recursion splits |

#### 6. Per-Branch Detail Blocks
- Branch A: Scan the range
  - Sub-branch A1: Compare each candidate to the pivot.
- Branch B: Swap lower values forward
  - Sub-branch B1: Move smaller values toward the front boundary.
- Branch C: Place the pivot
  - Sub-branch C1: Swap pivot into the final boundary position.

---

## Class: merg

### Class Summary

| Field | Value |
|-------|-------|
| FQN | `algo_Calc.merg` |
| Layer | Algorithm / utility |
| Methods | 12 |

`merg` implements merge sort with a conventional recursive split-and-merge structure. The class is responsible for copying partial arrays, merging two sorted halves, and recursively sorting the halves before combining them.

### Method: merge(int num[], int l, int m, int r)

#### 1. Role
This method merges two sorted subarrays into a single sorted interval. It is the core combine step of merge sort and writes results back into the original array.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `num` | `int[]` | Target array | Modified in place |
| `l` | `int` | Left boundary of the merged interval | Inclusive |
| `m` | `int` | Middle point | Separates the two halves |
| `r` | `int` | Right boundary of the merged interval | Inclusive |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| Temporary arrays `L` and `R` | C | Hold left and right halves |
| Array copies | R/U | Read values from the source array and write merged values back |
| Comparison logic | R | Chooses the next smallest element |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `mergeSort(...)` | Recursive merge sort | Called after both halves are sorted |

#### 6. Per-Branch Detail Blocks
- Branch A: Copy the left half
  - Sub-branch A1: Populate `L` from `num[l..m]`.
- Branch B: Copy the right half
  - Sub-branch B1: Populate `R` from `num[m+1..r]`.
- Branch C: Merge comparison loop
  - Sub-branch C1: Take the smaller head element from `L` or `R`.
- Branch D: Drain remaining values
  - Sub-branch D1: Copy any leftover values from either half.

### Method: mergeSort(int num[], int l, int r)

#### 1. Role
`mergeSort` recursively divides the array into smaller ranges until each range has one element, then merges those ranges back together in sorted order. It is the driver for the merge sort algorithm.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `num` | `int[]` | Array to sort | Modified in place |
| `l` | `int` | Left boundary | Inclusive |
| `r` | `int` | Right boundary | Inclusive |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| Recursive `mergeSort(...)` | U | Sorts left and right halves |
| `merge(...)` | U | Combines the sorted halves |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `Sortingss.initialize()` submit handler | Main UI path | Invoked when `key == 5` |

#### 6. Per-Branch Detail Blocks
- Branch A: Divide
  - Sub-branch A1: Compute midpoint.
  - Sub-branch A2: Recurse on left and right segments.
- Branch B: Conquer
  - Sub-branch B1: Merge once both halves are sorted.

---

## Class: heaps

### Class Summary

| Field | Value |
|-------|-------|
| FQN | `algo_Calc.heaps` |
| Layer | Algorithm / utility |
| Methods | 12 |

`heaps` implements a max-heap sort. It first builds a heap from the input array and then repeatedly extracts the largest value into its final position.

### Method: heapify(int num[], int size, int i)

#### 1. Role
`heapify` restores the max-heap property for the subtree rooted at index `i`. It is used both when building the heap and after each extraction in heap sort.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `num` | `int[]` | Heap-backed array | Modified in place |
| `size` | `int` | Active heap size | Elements beyond this are excluded |
| `i` | `int` | Root index of the subtree | Adjusted recursively if swapped |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| Index comparisons | R | Find the largest among parent and children |
| Array swaps | U | Restore heap order |
| Recursive `heapify(...)` | U | Propagate the fix downward |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `heapSort(...)` | Heap construction and extraction | Called repeatedly |

#### 6. Per-Branch Detail Blocks
- Branch A: Inspect children
  - Sub-branch A1: Compare the left child to the current largest value.
  - Sub-branch A2: Compare the right child to the current largest value.
- Branch B: Repair violations
  - Sub-branch B1: Swap the parent with the larger child when needed.
  - Sub-branch B2: Recurse into the affected subtree.

### Method: heapSort(int num[], int size)

#### 1. Role
`heapSort` sorts the full array in ascending order using a max-heap. It first heapifies the array, then repeatedly swaps the root with the last unsorted element and restores the heap on the remaining prefix.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `num` | `int[]` | Array to sort | Modified in place |
| `size` | `int` | Number of elements in the array | Controls heap boundaries |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `heapify(...)` | U | Builds and repairs the heap |
| Array swaps | U | Moves the max element to the end |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `Sortingss.initialize()` submit handler | Main UI path | Invoked when `key == 6` |

#### 6. Per-Branch Detail Blocks
- Branch A: Build the heap
  - Sub-branch A1: Heapify all non-leaf nodes from bottom up.
- Branch B: Extract maxima
  - Sub-branch B1: Swap the root with the last element.
  - Sub-branch B2: Heapify the reduced heap.

---

## Class: Frame

### Class Summary

| Field | Value |
|-------|-------|
| FQN | `algo_Calc.Frame` |
| Layer | Presentation / launcher |
| Methods | 12 |

`Frame` is a compact selection screen that creates a `Sortingss` instance and hands control to it by calling `vis`. It exists to let users choose which algorithm screen to open first.

### Method: main(String[] args)

#### 1. Role
This method launches the algorithm-selection window. It follows the standard Swing pattern of creating the UI on the event dispatch thread.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| `args` | `String[]` | Standard Java command-line arguments | Not used |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `EventQueue.invokeLater` | C | Schedules UI creation |
| `new Frame()` | C | Builds the launcher |
| `frame.setVisible(true)` | U | Displays the launcher window |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| JVM | `main(String[] args)` | Application startup |

#### 6. Per-Branch Detail Blocks
- Single path: create and display the menu window.

### Method: Frame()

#### 1. Role
The constructor immediately delegates to `initialize`. It contains no additional business logic.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| None | — | Object construction | No parameters |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `initialize()` | C | Creates the UI |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `main(String[] args)` | Startup | Direct construction path |

#### 6. Per-Branch Detail Blocks
- Single path: initialize the frame immediately.

### Method: initialize()

#### 1. Role
`initialize` builds the algorithm-selection screen and binds each button to a specific algorithm key. Each action hides the menu and opens the main `Sortingss` screen in the correct mode.

#### 3. Parameter Analysis
| Parameter | Type | Purpose | Notes |
|-----------|------|---------|------|
| None | — | UI initialization only | No parameters |

#### 4. CRUD Operations / Called Services
| Called Service | Type | Purpose |
|----------------|------|---------|
| `new JFrame()` | C | Creates the menu window |
| `new JButton(...)` | C | Creates one button per algorithm |
| `obj.vis(...)` | U | Switches the main sorting screen to the chosen algorithm |
| `frame.setVisible(false)` | U | Hides the menu after selection |

#### 5. Dependency Trace
| Caller | Entry Point | Notes |
|--------|-------------|------|
| `Frame()` | Constructor | Builds the full menu UI |

#### 6. Per-Branch Detail Blocks
- Branch A: Button creation
  - Sub-branch A1: Bubble sort button.
  - Sub-branch A2: Insertion sort button.
  - Sub-branch A3: Selection sort button.
  - Sub-branch A4: Merge sort button.
  - Sub-branch A5: Quick sort button.
  - Sub-branch A6: Max heap sort button.
- Branch B: Button handling
  - Sub-branch B1: Forward selection to `Sortingss.vis`.
  - Sub-branch B2: Hide the current frame.
