Easy -1.2 This is a straightforward algorithmic execution question requiring mechanical application of Shell sort with no problem-solving or insight. Students follow a memorized procedure, count operations, and apply a formula for shuttle sort comparisons. It's easier than average A-level maths as it tests recall and careful execution rather than mathematical reasoning.
Use a Shell sort 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 }
28 & 22 & 20 & 17 & 14 & 11 & 6 & 5
\end{array}$$
Write down the number of comparisons on the first pass.
Write down the number of swaps on the first pass.
Find the total number of comparisons needed to rearrange the original list of 8 numbers into ascending order using a shuttle sort.
(You do not need to perform a shuttle sort.)
2
\begin{enumerate}[label=(\alph*)]
\item Use a Shell sort 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 }
28 & 22 & 20 & 17 & 14 & 11 & 6 & 5
\end{array}$$
\item \begin{enumerate}[label=(\roman*)]
\item Write down the number of comparisons on the first pass.
\item Write down the number of swaps on the first pass.
\end{enumerate}\item Find the total number of comparisons needed to rearrange the original list of 8 numbers into ascending order using a shuttle sort.\\
(You do not need to perform a shuttle sort.)
\end{enumerate}
\hfill \mbox{\textit{AQA D1 2007 Q2 [8]}}