Algomination
Data Structures
AboutContact

Algomination

Learn algorithms and data structures through smooth, interactive visualizations.

SortingSearchingArray AlgorithmsData StructuresAboutContact

© 2026Algomination. Created by Omang Rawat & Rahul Soni.

Omang Rawat
Rahul Soni
All sorting algorithms

Selection Sort

Time O(n²)Space O(1)

Selects the smallest remaining element each pass and moves it into place.

8
4
1
6
3
9
2
Starting Selection Sort.
Step 1 / 50
MinimumComparingSwappingSorted

About Selection Sort

Selects the smallest remaining element each pass and moves it into place.

Time complexity: O(n²). Space complexity: O(1).

How it works, step by step

Core idea — Each pass scans the unsorted region for the smallest element and swaps it into place.

What each pass accomplishes — After pass k the k smallest elements are locked into their final positions at the front — the sorted region grows by one from the left each pass.

Use the interactive visualizer above to run Selection Sort on your own input and watch every comparison, swap, and operation animate step by step — pause, scrub, or replay at any speed.