- #1
Joystar77
- 125
- 0
Sort with Selection Sort algorithms the following list:
329, 363, 373, 334, 320
Give the intermediate lists at each step.
I found the following information about Selection Sort. It states as follows: "The idea of selection sort is rather simple: the next largest (or smallest) element in the array is repeatedly found and moved to its final position in the sorted array. In order to sort the array in increasing order, the smallest element at the beginning of the array and the largest element at the end, the largest element is selected and moved to the highest index position. This is done by swapping the element at the highest index and the largest element. The effective size of the array is then reduced by one element and the process is repeated on the smaller (sub array). The process ends when the effective size of the array becomes 1 (an array of 1 element is already sorted)."
Can someone please explain this in simpler terms? What does it mean when it says to give the intermediate lists at each step?
329, 363, 373, 334, 320
Give the intermediate lists at each step.
I found the following information about Selection Sort. It states as follows: "The idea of selection sort is rather simple: the next largest (or smallest) element in the array is repeatedly found and moved to its final position in the sorted array. In order to sort the array in increasing order, the smallest element at the beginning of the array and the largest element at the end, the largest element is selected and moved to the highest index position. This is done by swapping the element at the highest index and the largest element. The effective size of the array is then reduced by one element and the process is repeated on the smaller (sub array). The process ends when the effective size of the array becomes 1 (an array of 1 element is already sorted)."
Can someone please explain this in simpler terms? What does it mean when it says to give the intermediate lists at each step?