AQA D1 2005 January — Question 2 7 marks

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2005
SessionJanuary
Marks7
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeBubble Sort Execution
DifficultyEasy -1.8 This is a purely procedural question requiring mechanical application of the bubble sort algorithm with no problem-solving or insight needed. Students simply follow the algorithm step-by-step and count operations—significantly easier than typical A-level questions that require mathematical reasoning or technique selection.
Spec7.03j Sorting: bubble sort and shuttle sort

2
  1. Use a bubble sort algorithm to rearrange the following numbers into ascending order, showing the new arrangement after each pass. $$\begin{array} { l l l l l l l l } 19 & 3 & 7 & 20 & 2 & 6 & 5 & 15 \end{array}$$
  2. Write down the number of comparisons and the number of swaps during the first pass.
    (2 marks)

Question 2(a):
AnswerMarks Guidance
AnswerMarks Guidance
\(19\ 3\ 7\ 20\ 2\ 6\ 5\ 15 \to 3\ 7\ 19\ 2\ 6\ 5\ 15\ 20\)M1, A1, A1 Bubble sort; First pass for 19; First pass for 20
Second pass rows shown correctlyA1 \(2^{nd}\) pass
Final sorted list \((2\ 3\ 5\ 6\ 7\ 15\ 19\ 20)\)A1 5 All correct
Question 2(b):
AnswerMarks Guidance
AnswerMarks Guidance
7 comparisonsB1
6 swapsB1 2
Total: 7
## Question 2(a):

| Answer | Marks | Guidance |
|--------|-------|----------|
| $19\ 3\ 7\ 20\ 2\ 6\ 5\ 15 \to 3\ 7\ 19\ 2\ 6\ 5\ 15\ 20$ | M1, A1, A1 | Bubble sort; First pass for 19; First pass for 20 |
| Second pass rows shown correctly | A1 | $2^{nd}$ pass |
| Final sorted list $(2\ 3\ 5\ 6\ 7\ 15\ 19\ 20)$ | A1 | **5** All correct |

## Question 2(b):

| Answer | Marks | Guidance |
|--------|-------|----------|
| 7 comparisons | B1 | |
| 6 swaps | B1 | **2** |
| **Total: 7** | | |

---
2
\begin{enumerate}[label=(\alph*)]
\item Use a bubble sort algorithm to rearrange the following numbers into ascending order, showing the new arrangement after each pass.

$$\begin{array} { l l l l l l l l } 
19 & 3 & 7 & 20 & 2 & 6 & 5 & 15
\end{array}$$
\item Write down the number of comparisons and the number of swaps during the first pass.\\
(2 marks)
\end{enumerate}

\hfill \mbox{\textit{AQA D1 2005 Q2 [7]}}