OCR FD1 AS 2017 December — Question 6 6 marks

Exam BoardOCR
ModuleFD1 AS (Further Decision 1 AS)
Year2017
SessionDecember
Marks6
TopicSorting Algorithms
TypeBubble Sort Execution
DifficultyEasy -1.8 This is a purely mechanical execution of bubble sort requiring no problem-solving or insight—just following the algorithm step-by-step to record intermediate states. It's routine algorithmic practice well below average A-level difficulty, though the decreasing order adds minimal complexity.
Spec7.03j Sorting: bubble sort and shuttle sort

6 This list is to be sorted into decreasing order, ending up with 31 in the first position and 4 in the last position.
15
4
12
23
14
16
27
31 Initially bubble sort is used.
  1. Record the list at the end of the first, second and third passes. You do not need to show the individual swaps in each pass. After the fourth pass the list is:
    23
    15
    16
    27
    31
    14
    12

6 This list is to be sorted into decreasing order, ending up with 31 in the first position and 4 in the last position.\\
15\\
4\\
12\\
23\\
14\\
16\\
27\\
31

Initially bubble sort is used.\\
(i) Record the list at the end of the first, second and third passes. You do not need to show the individual swaps in each pass.

After the fourth pass the list is:\\
23\\
15\\
16\\
27\\
31\\
14\\
12\\

\hfill \mbox{\textit{OCR FD1 AS 2017 Q6 [6]}}