Edexcel D1 2018 June — Question 2 12 marks

Exam BoardEdexcel
ModuleD1 (Decision Mathematics 1)
Year2018
SessionJune
Marks12
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeDescribing Sorting Algorithm Steps
DifficultyEasy -1.2 This is a routine D1 question testing standard recall of bubble sort and quick sort algorithms with straightforward application. Parts (a)-(d) require describing/recognizing algorithm steps from the specification, while (e)-(f) apply the first-fit decreasing algorithm mechanically. No problem-solving insight or novel reasoning is needed—just faithful execution of learned procedures.
Spec7.03j Sorting: bubble sort and shuttle sort7.03k Sorting: quick sort7.03l Bin packing: next-fit, first-fit, first-fit decreasing, full bin

2. A list of nine numbers needs to be sorted into descending order.
  1. Describe how to carry out the first pass of a bubble sort on the numbers in the list. Mayleen used a sorting algorithm to sort a list of nine numbers into descending order. Mayleen's list after the first pass through the algorithm is given below. $$\begin{array} { l l l l l l l l l } 30 & 33 & 35 & 27 & 20 & 24 & 21 & 15 & 19 \end{array}$$
  2. Explain how you know that Mayleen did not use the bubble sort algorithm. Given that Mayleen used the quick sort algorithm,
  3. write down the number that was used as a pivot for the first pass,
  4. complete the quick sort to obtain a fully sorted list in descending order. You must make your pivots clear.
  5. Use the first-fit decreasing bin packing algorithm to determine how the numbers listed can be packed into bins of size 60 A tenth number, 18, is added to the list of nine numbers.
  6. Determine whether it is possible to pack the ten numbers into 4 bins of size 60 . You must justify your answer.

2. A list of nine numbers needs to be sorted into descending order.
\begin{enumerate}[label=(\alph*)]
\item Describe how to carry out the first pass of a bubble sort on the numbers in the list.

Mayleen used a sorting algorithm to sort a list of nine numbers into descending order. Mayleen's list after the first pass through the algorithm is given below.

$$\begin{array} { l l l l l l l l l } 
30 & 33 & 35 & 27 & 20 & 24 & 21 & 15 & 19
\end{array}$$
\item Explain how you know that Mayleen did not use the bubble sort algorithm.

Given that Mayleen used the quick sort algorithm,
\item write down the number that was used as a pivot for the first pass,
\item complete the quick sort to obtain a fully sorted list in descending order. You must make your pivots clear.
\item Use the first-fit decreasing bin packing algorithm to determine how the numbers listed can be packed into bins of size 60

A tenth number, 18, is added to the list of nine numbers.
\item Determine whether it is possible to pack the ten numbers into 4 bins of size 60 . You must justify your answer.
\end{enumerate}

\hfill \mbox{\textit{Edexcel D1 2018 Q2 [12]}}