The list below is to be sorted into increasing order using bubble sort.
\(\begin{array} { l l l l l l l l l l } 52 & 38 & 15 & 61 & 27 & 49 & 10 & 33 & 96 & 74 \end{array}\)
Determine the list that results at the end of the first, second and third passes. You do not need to show the individual swaps in each pass.
Write down the number of comparisons and the number of swaps used in each of these passes.
The list below is to be sorted into increasing order using shuttle sort.
\(\begin{array} { l l l l l l l l l l } 52 & 38 & 15 & 61 & 27 & 49 & 10 & 33 & 96 & 74 \end{array}\)
Determine the list that results at the end of the first, second and third passes. You do not need to show the individual swaps in each pass.
Write down the number of comparisons and the number of swaps used in each of these passes.
Use the results from parts (a) and (b) to compare the efficiency of bubble sort with the efficiency of shuttle sort for the first three passes of this list. You do not need to consider what happens after these three passes.