AS June 2024 Q1

EdexcelAS paperCurrent spec9 marksAlgorithms

1.

46.571.3251.564.561

The list of eleven numbers shown above is to be sorted into descending order.

(a) Carry out a quick sort to produce the sorted list. You should show the result of each pass and identify the pivots clearly. (3)
(b) Use the first-fit decreasing bin packing algorithm to pack the numbers into bins of size 10 (3)
(c) Determine whether your answer to part (b) uses the minimum number of bins. You must justify your answer. (2)

A different list of eleven numbers is to be sorted into descending order using a bubble sort. The list after the second pass is

4.55.63.86.75.41.64.89.13.31.71.5
(d) Explain how you know that at least one of the first two passes of the bubble sort was not carried out correctly. (1)