Question 2
OCR B (MEI) Further Maths November 2021 Modelling with algorithms (Y413-01)AS9 marks
On the specification
- (a)
- A1–A11 Modelling with Algorithms (Y413): Algorithms
- (b)
- A1–A11 Modelling with Algorithms (Y413): Algorithms
- (c)
- A1–A11 Modelling with Algorithms (Y413): Algorithms
- (d)
- A1–A11 Modelling with Algorithms (Y413): Algorithms
- (e)
- A1–A11 Modelling with Algorithms (Y413): Algorithms
Question text
2 The list below shows the sizes of eleven items. 15 4 23 16 2 12 14 11 20 13 22 (a) Show the result of applying the first fit algorithm to pack items with the sizes listed above into bins that have a capacity of 40. [2] (b) Apply the quick sort algorithm to sort the list of numbers above into descending order. You should use the first value as the pivot for each sublist. [3] (c) Show the result of applying the first fit decreasing algorithm to pack items with the sizes listed above into bins that have a capacity of 40. [2] (d) By considering the answers to parts (a) and (c) explain why first fit is an example of a heuristic algorithm. [1] The quick sort algorithm is to be used to sort a different list of eight numbers into descending order. After one pass through the list the quick sort algorithm produces the following list 18 22 17 19 14 11 4 13 (e) State, with a reason, which number was used as a pivot for the first pass. [1]