Respuesta :
Explanation:
Selection sorting is an sorting that select the lowest element or highest element from the unsorted and putting them into the beginning of the array this process is repeat again and again until all the array element are not picked in unsorted array .It sorts the element in either ascending order or Descending order .The selection sorting is a simple sorting that divide the array in two parts sorted array and the remaining array I. e; unsorted array
Following are the example of selection sorting how the selection sorting are done in unsorted array.
Assume that the array [5,6,7,0] needs to be sorted in ascending order.
Step 1: We find the minimum element in the array i.e. 0 and swapped with the first postion of the array
so array becomes: [0] [6,7,5]
sorted array unsorted array
Step 2:Find the minimum element in the remaining unsorted array I.e 5 and swapped with the second postion of the array
so array becomes [0,5] [7,6]
sorted array unsorted array
Step 3:Find again minimum element in the remaining unsorted array I.e 6 and swapped with the third position of the array
so array becomes
[0,5,6] [7]
sorted array unsorted array
Step 4:Here in last step we see that only one element is present in the unsorted array so put directly into sorted array in last position of an sorted array .
So sorted array becomes
[0,5,6,7]