Selection Sort Algorithm

Selection Sort Algorithm Visually

An in-place comparison sorting algorithm that divides the input list into a sorted and an unsorted region, repeatedly selecting the smallest element.

Sorting Algorithm Unstable Algorithm Time Complexity O(n²) Space Complexity O(1) Beginner Friendly
Selection Sort Controls
Swaps: 0
Comparisons: 0
Steps: 0

Algorithm Status

Ready
Progress 0%

Array Visualization

About Selection Sort

Selection sort is an in-place comparison sorting algorithm that divides the input list into two parts: the sublist of items already sorted, which is built up from left to right at the front of the list, and the sublist of items remaining to be sorted that occupy the rest of the list. The algorithm proceeds by finding the smallest element in the unsorted sublist, exchanging it with the leftmost unsorted element, and moving the sublist boundaries one element to the right.

Time Complexity
O(n²)
Worst Case
Space Complexity
O(1)
Auxiliary

Execution Log

Operation Log
Selection sort visualization initialized
Enter array values and click Initialize to begin