Selection Sort

Selection Sort For absolute Beginners

Selection Sort is a simple sorting algorithm that divides the input list into two parts: the sorted part and the unsorted part. It repeatedly selects the smallest (or largest) element from the unsorted part and moves it to the sorted part.

See it in action

42
30
9
6
14
22
25
4
17
39
27
22
42
36
19

Time Complexity

  • Best Case: O(n^2)
  • Average Case: O(n^2)
  • Worst Case: O(n^2)

Space Complexity

  • O(1)

/> Devy.in© 2025Made from scratch with ❤️ & 🍵