AQA D1 2010 June — Question 2

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2010
SessionJune
TopicSorting Algorithms

2
    1. Use a bubble sort to rearrange the following numbers into ascending order, showing the list of numbers after each pass. $$\begin{array} { l l l l l } 6 & 2 & 3 & 5 & 4 \end{array}$$
    2. Write down the number of comparisons on the first pass.
    1. Use a shuttle sort to rearrange the following numbers into ascending order, showing the list of numbers after each pass. $$\begin{array} { l l l l l } 6 & 2 & 3 & 5 & 4 \end{array}$$
    2. Write down the number of comparisons on the first pass.
      \includegraphics[max width=\textwidth, alt={}]{fe9c0da0-40e3-4a87-ae9a-13ec0740ffff-05_2484_1709_223_153}