Name ______________________ Date ___/___/______
Sorting Algorithms
Worksheet
Worksheet 3
1) What would the list below look like after a single pass of
bubble sort? (show all swaps)
2
17 69 51 83 14 19 0 0 2nd
2 1 3 0
In bubble sort, which two items would be swapped first using
2) 1
the list below?
6 32 90 68 51 6
3) Merge sort uses a 'divide and conquer' technique. Show how
the list below would be sorted using merge sort.
0.8421923
38 79 44 28 66
4) When swapping items of data, how many variables are 0
0.61914178 required?
5) Which algorithm would be most efficient sorting a list 65
0.48055789 containing 65 items? 2
© TeachAllAboutIT 2020
More GCSE A Level Computer Science Resources at www.TeachAllAboutIt.school
Name ______________________ Date ___/___/______
Sorting Algorithms
Answer Sheet
Worksheet 3
1) The items would be compared in pairs and swapped if not in
order. The first pass stops when the last pair in the list is compared.
swap 1: 17 69 51 83 14 19
swap 2: 17 51 69 83 14 19
swap 3: 17 51 69 83 14 19
swap 4: 17 51 69 14 83 19
swap 5: 17 51 69 14 19 83
2) 90 & 68
3) 38 79 44 28 66
38 79 44 28 66
38 79 44 28 66
38 79 44 28 66
38 79 44 28 66
38 79 44 28 66
38 79 44 28 66
4) Three variables are required to swap. The two items of data and a third
temporary variable to allow each item of data to be moved in turn.
5) For larger data sets, merge sort is more efficient as there are fewer iterations (loops)
needed to sort the data
© TeachAllAboutIT 2020
More GCSE A Level Computer Science Resources at www.TeachAllAboutIt.school