AQA D1 2006 January — Question 2 5 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2006
SessionJanuary
Marks5
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeQuick Sort Execution
DifficultyEasy -1.2 This is a straightforward algorithmic execution question requiring only mechanical application of the quicksort algorithm with no problem-solving or insight needed. Students simply follow the standard procedure, choose pivots (typically the first element), partition, and repeat—pure recall and routine application, making it easier than average.
Spec7.03k Sorting: quick sort

2 Use the quicksort algorithm to rearrange the following numbers into ascending order. Indicate clearly the pivots that you use. $$\begin{array} { l l l l l l l l } 18 & 23 & 12 & 7 & 26 & 19 & 16 & 24 \end{array}$$

Question 2:
AnswerMarks Guidance
AnswerMarks Guidance
\(\underline{18}\ 23\ 12\ 7\ 26\ 19\ 16\ 24\)M1 M1 SCA, consistent points
\(\underline{12}\ 7\ 16\ \boxed{18}\ 23\ 26\ 19\ 24\)A1 \(1^{\text{st}}\) pass
\(7\ \boxed{12}\ 16\ \boxed{18}\ 19\ \boxed{23}\ 26\ 24\)A1 \(2^{\text{nd}}\) pass
\(\boxed{7}\ \boxed{12}\ \boxed{16}\ \boxed{18}\ \boxed{19}\ \boxed{23}\ 24\ \boxed{26}\)A1 all correct
Total: 5 marks
## Question 2:

| Answer | Marks | Guidance |
|--------|-------|----------|
| $\underline{18}\ 23\ 12\ 7\ 26\ 19\ 16\ 24$ | M1 M1 | SCA, consistent points |
| $\underline{12}\ 7\ 16\ \boxed{18}\ 23\ 26\ 19\ 24$ | A1 | $1^{\text{st}}$ pass |
| $7\ \boxed{12}\ 16\ \boxed{18}\ 19\ \boxed{23}\ 26\ 24$ | A1 | $2^{\text{nd}}$ pass |
| $\boxed{7}\ \boxed{12}\ \boxed{16}\ \boxed{18}\ \boxed{19}\ \boxed{23}\ 24\ \boxed{26}$ | A1 | all correct |

**Total: 5 marks**

---
2 Use the quicksort algorithm to rearrange the following numbers into ascending order. Indicate clearly the pivots that you use.

$$\begin{array} { l l l l l l l l } 
18 & 23 & 12 & 7 & 26 & 19 & 16 & 24
\end{array}$$

\hfill \mbox{\textit{AQA D1 2006 Q2 [5]}}