Selection Sort
here we identify minimum value index then swap it with first index then loop over again and identify the second minimum element to be swapped with the second index and so on
Algorithm steps are
- Step 1 − Set MIN to location 0
- Step 2 − Search the minimum element in the list
- Step 3 − Swap with value at location MIN
- Step 4 − Increment MIN to point to next element
- Step 5 − Repeat until list is sorted
time complexity O(n^2) space complexity S(1)
- In-Place comparison-based algorithm
- Stable Sorting algorithm
- Adaptive algorithm