D1 January 2011 Q2

EdexcelOld spec12 marksAlgorithms

2.

23     29     11     34     10     14     35     17

The numbers represent the sizes, in megabytes (MB), of eight files.

The files are to be stored on 50 MB discs.

(a) Calculate a lower bound for the number of discs needed to store all eight files. (2)
(b) Use the first-fit bin packing algorithm to fit the files onto the discs. (3)
(c) Perform a bubble sort on the numbers in the list to sort them into descending order. You need only write down the final result of each pass. (4)
(d) Use the first-fit decreasing bin packing algorithm to fit the files onto the discs. (3)