CZ
CalcyZone
computer-science Verified Precision Tool

Selection Sort Visualizer & Calculator

Step-by-step Selection Sort execution visualizer tracking minimum element indices, swaps, and comparisons.

Interactive Algorithm Visualizer

Selection Sort

Enter your custom input data → Run the real algorithm engine → Observe step transitions.

⚙️ Customize Algorithm Input Data

Step 1 of 15⚡ Algorithm Running
WHAT HAPPENED?

Initial array state for Selection Sort.

WHY?

Algorithm state rule requirement

WHAT CHANGED?

State pointers updated

64
[0]
25
[1]
12
[2]
22
[3]
11
[4]

Mathematical Formula

Find minimum element in unsubarray; swap with first unsorted index i

Overview & Explanation

Selection Sort divides the array into a sorted and unsorted region, repeatedly picking the minimum element from the unsorted region and moving it to the sorted region.

How It Works

  • Find the smallest element in the unsorted subarray.
  • Swap it with the element at the beginning of the unsorted subarray.
  • Advance the boundary between sorted and unsorted subarrays.

Practical Applications

  • Small array sorting with minimal memory writes
  • Algorithm analysis

Selection Sort Example

Sorting array [29, 10, 14, 37, 13]

1

Step 1

Min = 10

= Swap with 29 -> [10, 29, 14, 37, 13]
2

Step 2

Min = 13

= Swap with 29 -> [10, 13, 14, 37, 29]
3

Completion

Sorted

= [10, 13, 14, 29, 37]

Frequently Asked Questions

Is Selection Sort stable?
Standard Selection Sort is not stable because long-distance swaps can change the relative order of equal elements.