Edexcel D1 2005 January — Question 4

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

4. \(\quad \begin{array} { l l l l l l l l l l } 650 & 431 & 245 & 643 & 455 & 134 & 710 & 234 & 162 & 452 \end{array}\)
  1. The list of numbers above is to be sorted into descending order. Perform a Quick Sort to obtain the sorted list, giving the state of the list after each pass, indicating the pivot elements.
    (5) The numbers in the list represent the lengths, in mm, of some pieces of wood. The wood is sold in one metre lengths.
  2. Use the first-fit decreasing bin packing algorithm to determine how these pieces could be cut from the minimum number of one metre lengths. (You should ignore wastage due to cutting.)
    (4)
  3. Determine whether your solution to part (b) is optimal. Give a reason for your answer.
    (2)