Edexcel D1 2010 January — Question 4

Exam BoardEdexcel
ModuleD1 (Decision Mathematics 1)
Year2010
SessionJanuary
TopicSorting Algorithms

4. A builder is asked to replace the guttering on a house. The lengths needed, in metres, are $$0.6,4.0,2.5,3.2,0.5,2.6,0.4,0.3,4.0 \text { and } 1.0$$ Guttering is sold in 4 m lengths.
  1. Carry out a quick sort to produce a list of the lengths needed in descending order. You should show the result of each pass and identify your pivots clearly.
  2. Apply the first-fit decreasing bin-packing algorithm to your ordered list to determine the total number of 4 m lengths needed.
  3. Does the answer to part (b) use the minimum number of 4 m lengths? You must justify your answer.