Question 3
OCR A Further Maths June 2025 Discrete mathematics (Y544-01)A level8 marks
On the specification
- (a)
- 7.03 Algorithms
- (b)
- 7.03 Algorithms
- (c)
- 7.03 Algorithms
- (d)
- 7.03 Algorithms
Question text
3 Hiro uses a sorting algorithm to sort the heights in cm of 8 people into ascending order. At the end of the first pass through the algorithm, Hiro ends up with the list below: 142 165 152 135 171 154 172 182 (a) If Hiro used the shuttle sort algorithm, write down the possibilities for the original list. [1] Hiro actually used the bubble sort algorithm starting at the left-hand side. (b) Complete the second and third passes using the bubble sort algorithm. You should show the list that results at the end of each pass. [2] In total, Hiro needed 5 passes to complete the bubble sort algorithm. In total, the shuttle sort algorithm would take 12 comparisons to sort the original list into ascending order. (c) Using the total number of comparisons for each algorithm, compare the efficiency of bubble sort and shuttle sort for sorting the heights of the 8 people. [3] -3 (d) It takes a computer 2 4. #10 seconds to sort a list of 300 numbers into ascending order using the bubble sort algorithm. Find the approximate length of a list the computer could sort in 1 minute. Give your answer to 1 significant figure. [2]