OCR Further Discrete AS 2023 June — Question 3

Exam BoardOCR
ModuleFurther Discrete AS (Further Discrete AS)
Year2023
SessionJune
TopicPermutations & Arrangements
TypeAssignment/allocation matching problems

3 The list of numbers below is to be sorted into increasing order.
\(\begin{array} { l l l l l l l l } 23 & 10 & 18 & 7 & 62 & 54 & 31 & 82 \end{array}\)
  1. Sort the list using bubble sort. You do not need to show intermediate working.
    1. Record the list that results at the end of each pass.
    2. Record the number of swaps used in each pass.
  2. Now sort the original list using shuttle sort. You do not need to show intermediate working.
    1. Record the list that results at the end of each pass.
    2. Record the number of swaps used in each pass.
  3. Using the total number of comparisons plus the total number of swaps as a measure of efficiency, explain why shuttle sort is more efficient than bubble sort for sorting this particular list. Bubble sort and shuttle sort are both \(\mathrm { O } \left( n ^ { 2 } \right)\).
  4. Explain what this means for the run-time of the algorithms when the length of the list being sorted changes from 1000 to 3000.