D1 June 2014 (R) Q1

EdexcelOld spec11 marksAlgorithms

1.

31     10     38     45     19     47     35     28     12

(a) Use the first-fit bin packing algorithm to determine how the numbers listed above can be packed into bins of size 60 (3)
(b) Carry out a quick sort to produce a list of the numbers in descending order. You should show the result of each pass and identify your pivots clearly. (4)
(c) Use the first-fit decreasing bin packing algorithm to determine how the numbers listed can be packed into bins of size 60 (2)
(d) Determine whether the number of bins used in (c) is optimal. Give a reason for your answer. (2)