2. A list of nine numbers needs to be sorted into descending order.
- Describe how to carry out the first pass of a bubble sort on the numbers in the list.
Mayleen used a sorting algorithm to sort a list of nine numbers into descending order. Mayleen's list after the first pass through the algorithm is given below.
$$\begin{array} { l l l l l l l l l }
30 & 33 & 35 & 27 & 20 & 24 & 21 & 15 & 19
\end{array}$$
- Explain how you know that Mayleen did not use the bubble sort algorithm.
Given that Mayleen used the quick sort algorithm,
- write down the number that was used as a pivot for the first pass,
- complete the quick sort to obtain a fully sorted list in descending order. You must make your pivots clear.
- Use the first-fit decreasing bin packing algorithm to determine how the numbers listed can be packed into bins of size 60
A tenth number, 18, is added to the list of nine numbers.
- Determine whether it is possible to pack the ten numbers into 4 bins of size 60 . You must justify your answer.