3. \(\quad \begin{array} { l l l l l l l l l l } 2.6 & 0.8 & 2.1 & 1.2 & 0.9 & 1.7 & 2.3 & 0.3 & 1.8 & 2.7 \end{array}\)
- Use the first-fit bin packing algorithm to determine how the numbers listed above can be packed into bins of size 5
The list is to be sorted into descending order.
- Starting at the left-hand end of the above list, perform two passes through the list using a bubble sort. Write down the lists that result at the end of the first pass and the second pass.
- Write down, in the table in the answer book, the number of comparisons and the number of swaps performed during each of these two passes.
After a third pass using this bubble sort, the updated list is
$$\begin{array} { l l l l l l l l l l }
2.6 & 2.1 & 1.7 & 2.3 & 1.2 & 1.8 & 2.7 & 0.9 & 0.8 & 0.3
\end{array}$$
- Use a quick sort on this updated list to obtain the fully sorted list. You must make your pivots clear.
- Apply the first-fit decreasing bin packing algorithm to the fully sorted list to pack the numbers into bins of size 5