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
5
5
24
12
46
21
47
11
47
40
6
5
6
33
28
Time Complexity
- Best Case: O(n^2)
- Average Case: O(n^2)
- Worst Case: O(n^2)
Space Complexity
- O(1)