AQA D1 2013 January — Question 2 5 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2013
SessionJanuary
Marks5
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeShell Sort Execution
DifficultyEasy -1.2 This is a straightforward procedural question requiring mechanical application of the Shell sort algorithm with a small dataset (8 elements). It tests recall and careful execution of a standard algorithm rather than problem-solving or mathematical insight, making it easier than average A-level questions.
Spec7.03j Sorting: bubble sort and shuttle sort

2
  1. Use a Shell sort to arrange the following numbers into ascending order. $$\begin{array} { l l l l l l l l } 7 & 8 & 1 & 6 & 3 & 4 & 5 & 2 \end{array}$$
  2. Write down the number of comparisons on the first pass.

Question 2:
Part (a)
AnswerMarks Guidance
AnswerMarks Guidance
Split into groups of 4 and 4: \([7\ 8\ 1\ 6]\ [3\ 4\ 5\ 2]\), merge-sort each halfM1 Correct shell sort split and first pass shown
After first pass: \(1\ 6\ 7\ 8\ 2\ 3\ 4\ 5\) (or equivalent correct intermediate)A1 Correct result after first pass
After second pass: \(1\ 2\ 3\ 6\ 4\ 5\ 7\ 8\) (merging)A1 Correct second pass
Final sorted: \(1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\)A1 Correct final answer
Part (b)
AnswerMarks Guidance
AnswerMarks Guidance
\(4\) comparisons on the first passB1 Accept 4
# Question 2:

## Part (a)
| Answer | Marks | Guidance |
|--------|-------|----------|
| Split into groups of 4 and 4: $[7\ 8\ 1\ 6]\ [3\ 4\ 5\ 2]$, merge-sort each half | M1 | Correct shell sort split and first pass shown |
| After first pass: $1\ 6\ 7\ 8\ 2\ 3\ 4\ 5$ (or equivalent correct intermediate) | A1 | Correct result after first pass |
| After second pass: $1\ 2\ 3\ 6\ 4\ 5\ 7\ 8$ (merging) | A1 | Correct second pass |
| Final sorted: $1\ 2\ 3\ 4\ 5\ 6\ 7\ 8$ | A1 | Correct final answer |

## Part (b)
| Answer | Marks | Guidance |
|--------|-------|----------|
| $4$ comparisons on the first pass | B1 | Accept 4 |

---
2
\begin{enumerate}[label=(\alph*)]
\item Use a Shell sort to arrange the following numbers into ascending order.

$$\begin{array} { l l l l l l l l } 
7 & 8 & 1 & 6 & 3 & 4 & 5 & 2
\end{array}$$
\item Write down the number of comparisons on the first pass.
\end{enumerate}

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