All About Selection Sort
.png)
- In Selection Sort, the minimum value in the array of unsorted elements is selected in every pass and is placed to its correct position into the array.
- In this algorithm, the array is divided into two parts, one is sorted part, and the second one is the unsorted part.
- In the beginning, empty part of the array is the sorted part, and the given array is the unsorted part.
- Sorted and unsorted part are placed accordingly, in the left side sorted part is there, while on the right side unsorted part is placed.
- So, in this method, the first smallest element is selected from the array(unsorted) and is placed at the first position. After doing this, the second smallest element is selected and is placed in the second position.
- This entire process continues until the array is entirely sorted.
6

