Question 2
OCR Computer Science November 2020 Paper 2AS15 marks
On the specification
- (a)
- 2.3 Algorithms
- (b)
- 2.3 Algorithms
- (c)
- 2.2 Problem solving and programming2.3 Algorithms
- (d)
- 2.3 Algorithms
Question text
2 Poppy would like to use a bubble sort to sort 250 000 numbers into order from lowest to highest. Currently the first five numbers before they have been sorted are: 195 584 167 147 158 187 160 125 184 236 Currently the last five numbers before they have been sorted are: 1058 19 558 1915 20 215 15 (a)* Discuss how a bubble sort works and how efficient it will be when sorting these 250 000 items into order from lowest to highest. [9] (b) State the number of comparisons that will need to be made in the first pass of the bubble sort. [1] (c) Bubble sorts make use of two different loops when sorting items into order. Describe the two loops used and their purpose. 1 2 [4] (d) State the name of one other sorting algorithm that Poppy could have used. [1]