AQA D1 2015 June — Question 3 5 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2015
SessionJune
Marks5
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeMaximum Comparisons or Swaps
DifficultyEasy -1.2 This question tests pure recall of standard sorting algorithm properties with no problem-solving required. Each part asks for a memorized fact about comparison counts (quicksort first pass: n-1=15, Shell sort first pass depends on gap sequence, shuttle sort final pass: 1, bubble sort maximum: n(n-1)/2=120). No derivation, insight, or multi-step reasoning needed—just direct application of learned formulas.
Spec7.03j Sorting: bubble sort and shuttle sort7.03k Sorting: quick sort

3 Four students, \(A , B , C\) and \(D\), are using different algorithms to sort 16 numbers into ascending order.
  1. Student \(A\) uses the quicksort algorithm. State the number of comparisons on the first pass.
  2. Student \(B\) uses the Shell sort algorithm. State the number of comparisons on the first pass.
  3. Student \(C\) uses the shuttle sort algorithm. State the minimum number of comparisons on the final pass.
  4. Student \(D\) uses the bubble sort algorithm. Find the maximum total number of comparisons.

Question 3:
(a)
AnswerMarks Guidance
AnswerMarks Guidance
\(15\) comparisonsB1 quicksort first pass on 16 numbers: pivot compared with remaining \(n-1\)
(b)
AnswerMarks Guidance
AnswerMarks Guidance
\(8\) comparisonsB1 Shell sort first pass: 16 numbers with gap 8, giving 8 comparisons
(c)
AnswerMarks Guidance
AnswerMarks Guidance
\(1\) comparisonB1 minimum on final pass of shuttle sort (already sorted sub-list)
(d)
AnswerMarks Guidance
AnswerMarks Guidance
Maximum total for bubble sort on 16 numbers \(= \frac{16 \times 15}{2} = 120\)M1 correct use of \(\frac{n(n-1)}{2}\)
\(120\) comparisonsA1 correct answer
# Question 3:

**(a)**

| Answer | Marks | Guidance |
|--------|-------|----------|
| $15$ comparisons | B1 | quicksort first pass on 16 numbers: pivot compared with remaining $n-1$ |

**(b)**

| Answer | Marks | Guidance |
|--------|-------|----------|
| $8$ comparisons | B1 | Shell sort first pass: 16 numbers with gap 8, giving 8 comparisons |

**(c)**

| Answer | Marks | Guidance |
|--------|-------|----------|
| $1$ comparison | B1 | minimum on final pass of shuttle sort (already sorted sub-list) |

**(d)**

| Answer | Marks | Guidance |
|--------|-------|----------|
| Maximum total for bubble sort on 16 numbers $= \frac{16 \times 15}{2} = 120$ | M1 | correct use of $\frac{n(n-1)}{2}$ |
| $120$ comparisons | A1 | correct answer |
3 Four students, $A , B , C$ and $D$, are using different algorithms to sort 16 numbers into ascending order.
\begin{enumerate}[label=(\alph*)]
\item Student $A$ uses the quicksort algorithm.

State the number of comparisons on the first pass.
\item Student $B$ uses the Shell sort algorithm.

State the number of comparisons on the first pass.
\item Student $C$ uses the shuttle sort algorithm.

State the minimum number of comparisons on the final pass.
\item Student $D$ uses the bubble sort algorithm.

Find the maximum total number of comparisons.
\end{enumerate}

\hfill \mbox{\textit{AQA D1 2015 Q3 [5]}}