Edexcel D1 2009 January — Question 1 9 marks

Exam BoardEdexcel
ModuleD1 (Decision Mathematics 1)
Year2009
SessionJanuary
Marks9
PaperDownload PDF ↗
Mark schemeDownload PDF ↗
TopicSorting Algorithms
TypeQuick Sort Execution
DifficultyEasy -1.8 This is a straightforward algorithmic execution question requiring only mechanical application of quick sort and binary search procedures with no problem-solving or insight. The alphabetical ordering is trivial, and both algorithms are standard D1 procedures tested routinely at this basic level.
Spec7.03c Working with algorithms: trace, interpret, adapt7.03k Sorting: quick sort

1. Max Lauren John Hannah Kieran Tara Richard Imogen
  1. Use a quick sort to produce a list of these names in ascending alphabetical order. You must make your pivots clear.
  2. Use the binary search algorithm on your list from part (a) to try to locate the name 'Hugo'.

Question 1:
Part (a)
AnswerMarks Guidance
Answer/WorkingMarks Guidance
Quick sort performed with pivot chosen and two sublists one \(p\)M1 If choosing 1 pivot per iteration only M1 only
First pass correct: M L J H K T R I → J H I K M L T R (pivot K highlighted)A1 First pass correct and next pivots chosen correctly/consistently
Second pass correctA1ft Second pass correct, next pivots correctly/consistently chosen
Third pass correctA1ft Third pass correctly/consistently chosen
Sort completeA1cso All correct, cso
Part (b)
AnswerMarks Guidance
Answer/WorkingMarks Guidance
\(1^{\text{st}}\) choice \(\left\lceil\frac{1+8}{2}\right\rceil \rightarrow 5\) Lauren, reject rightM1 A1 Binary search, choosing pivot, rejecting half list. If using unsorted list, M0. Accept choice of K for M1 only
\(2^{\text{nd}}\) choice \(\left\lceil\frac{1+4}{2}\right\rceil \rightarrow 3\) John, reject rightA1ft First pass correct, condone 'sticky' pivot here, bod. Second pass correct, pivot rejected
\(3^{\text{rd}}\) choice \(\left\lceil\frac{1+2}{2}\right\rceil \rightarrow 2\) Imogen, reject right
\(4^{\text{th}}\) choice 1 Hannah, reject. List now empty so Hugo not in listA1 cso
# Question 1:

## Part (a)
| Answer/Working | Marks | Guidance |
|---|---|---|
| Quick sort performed with pivot chosen and two sublists one $<p$ one $>p$ | M1 | If choosing 1 pivot per iteration only M1 only |
| First pass correct: M L J H **K** T R I → J H I K M L T R (pivot K highlighted) | A1 | First pass correct and next pivots chosen correctly/consistently |
| Second pass correct | A1ft | Second pass correct, next pivots correctly/consistently chosen |
| Third pass correct | A1ft | Third pass correctly/consistently chosen |
| Sort complete | A1cso | All correct, cso |

## Part (b)
| Answer/Working | Marks | Guidance |
|---|---|---|
| $1^{\text{st}}$ choice $\left\lceil\frac{1+8}{2}\right\rceil \rightarrow 5$ Lauren, reject right | M1 A1 | Binary search, choosing pivot, rejecting half list. If using unsorted list, M0. Accept choice of K for M1 only |
| $2^{\text{nd}}$ choice $\left\lceil\frac{1+4}{2}\right\rceil \rightarrow 3$ John, reject right | A1ft | First pass correct, condone 'sticky' pivot here, bod. Second pass correct, pivot rejected |
| $3^{\text{rd}}$ choice $\left\lceil\frac{1+2}{2}\right\rceil \rightarrow 2$ Imogen, reject right | | |
| $4^{\text{th}}$ choice 1 Hannah, reject. List now empty so Hugo not in list | A1 | cso |

---
1.

Max Lauren John Hannah Kieran Tara Richard Imogen
\begin{enumerate}[label=(\alph*)]
\item Use a quick sort to produce a list of these names in ascending alphabetical order. You must make your pivots clear.
\item Use the binary search algorithm on your list from part (a) to try to locate the name 'Hugo'.
\end{enumerate}

\hfill \mbox{\textit{Edexcel D1 2009 Q1 [9]}}