Sorting-Algorithms-Worksheet-3
Sorting-Algorithms-Worksheet-3
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
© TeachAllAboutIT 2020
More GCSE A Level Computer Science Resources at www.TeachAllAboutIt.school
Name ______________________ Date ___/___/______
Sorting Algorithms
Answer Sheet
Worksheet 3
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