Skip to content
DSA Visualizerpreview

Selection sort

Find the smallest value left and swap it to the front, one place at a time.

O(n²) time · O(1) space

Values29, 10, 14, 37, 13, 5

Start with the array 29, 10, 14, 37, 13, 5.

Array of 6 values: 29, 10, 14, 37, 13, 5.
  • compare
  • swap or write
  • settled

1 / 27

Speed

Space play · ← → step · Home End jump · drag the strip to scrub