0% found this document useful (0 votes)
2 views

Sorting-Algorithms-Worksheet-3

The document is a worksheet on sorting algorithms, including bubble sort and merge sort, with questions requiring students to demonstrate their understanding of these concepts. It includes tasks such as performing a single pass of bubble sort, identifying swaps, and explaining the efficiency of sorting algorithms. The answer sheet provides detailed responses to each question, illustrating the sorting processes and the number of variables needed for swapping.

Uploaded by

Saqib Tipo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Sorting-Algorithms-Worksheet-3

The document is a worksheet on sorting algorithms, including bubble sort and merge sort, with questions requiring students to demonstrate their understanding of these concepts. It includes tasks such as performing a single pass of bubble sort, identifying swaps, and explaining the efficiency of sorting algorithms. The answer sheet provides detailed responses to each question, illustrating the sorting processes and the number of variables needed for swapping.

Uploaded by

Saqib Tipo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like