Explain the sentence: The selection sort algorithm not only does comparisons; it also does exchanges.
What will be an ideal response?
Even if the largest number in the unsorted section of a list is already at the end of the unsorted section, the selection sort algorithm exchanges this number with itself. Therefore, the algorithm does n exchanges, one for each position in the list to put the correct value in that position. With every exchange, the marker gets moved. (However, the work contributed by exchanges and market moving is so much less than the amount contributed by comparisons that it can be ignored.)
You might also like to view...
The formula result displaying in a cell will be in decimal format when dividing an amount by a total
Indicate whether the statement is true or false
Which of the following is NOT a method for creating a template?
A) Use a new blank presentation B) Save an existing presentation as a .pptx file C) Modify the master slides for an existing presentation D) Modify an existing template