Exchange sort these numbers. And include steps please 7 8 9 3 2 6 4 1 5 0
Exchange sorting
The exchange sort is similar to its cousin, the bubble sort, in that it compares the elements of an array and swaps those that are out of order. (Some people refer to "swap sort" as "bubble sort".) The difference between the two kinds is the way they compare elements. The exchange sort compares the first element with each subsequent element of the array and performs any necessary swaps.
When the first pass through the array is complete, the exchange sort then takes the second element and compares it to each subsequent element of the array swap elements that are out of order. This sorting process continues until the entire array is sorted.
Let's explore our same table of elements again using swap sort for descending order. Note that a "pass" is defined as one complete path through the array comparing and, if necessary, swapping elements
Stock sorting is slightly more efficient than bubble sorting in some situations. It is not necessary for the exchange class to make the last full pass, which needs bubble sort to determine that it is complete.
Step by step
Solved in 3 steps