← Back to Algorithms

Selection Sort

Divides the input list into a sorted and an unsorted region, and repeatedly selects the smallest element from the unsorted region to add to the sorted region.

Current Operation

Click 'Sort' to start visualization

Step: 0/0

Time Complexity: O(n²)
Space Complexity: O(1)

How it Works

Step-by-Step Process:

1. Find minimum element in unsorted portion

2. Swap it with first unsorted element

3. Move boundary of sorted portion one element right

4. Repeat until array is sorted