225k views
5 votes
The ________ sort usually performs fewer exchanges than the ________ sort.

A) bubble, selection
B) binary, linear
C) selection, bubble
D) ANSI, ASCII
E) None of these

User Flops
by
8.1k points

1 Answer

0 votes

Final answer:

The selection sort usually performs fewer exchanges than the bubble sort, because it makes only one exchange per pass through the list, unlike bubble sort which can make several exchanges per pass.

Step-by-step explanation:

The question addresses the efficiency of different sorting algorithms. The correct answer is: The selection sort usually performs fewer exchanges than the bubble sort.

In a bubble sort, elements are repeatedly swapped if they are in the wrong order, which can result in many exchanges, especially in the worst-case scenario where the list is in reverse order. However, with the selection sort, the algorithm looks for the smallest (or largest, depending on sorting order) element and exchanges it with the first unsorted element, which results in fewer exchanges compared to bubble sort. The selection sort minimizes the number of swaps because it only swaps once per pass through the list, regardless of how unsorted the list is.

User Wosh
by
8.1k points