KS4 – Algorithms Summative assessment – Answers
Summative assessment – Answers
Q1. Read the description below and then select which term it is referring to:
“The process of removing unnecessary information and focussing on the
important details, allowing you to develop a general idea of what the problem is
and how to solve it.”
a. Decomposition
b. Abstraction
c. Algorithmic thinking
d. Computational thinking
Q2. A sample of alphabetically sorted data is shown below:
Crane Finch Heron Kiwi Owl Stork Wren
A. Which searching algorithm would result in the least number of comparisons when
the search item is “Crane”?
Linear search
B. Which searching algorithm would result in the least number of comparisons when
the search item is “Wren”?
Binary search
C. List each of the items that would be compared to the search item “Robin” when
performing a binary search.
Kiwi, Stork, Owl
Page 1 Last updated: 29/09/2021
KS4 – Algorithms Summative assessment – Answers
Q3. Read the description below and then select which algorithm it is referring to:
“Split data until each item is in a list of its own and then combine pairs of lists
repeatedly so that the items are in order.”
a. Bubble sort
b. Merge sort
c. Insertion sort
d. Binary search
Q4. Read the description below and then select which algorithm it is referring to:
“Move through a list repeatedly, comparing items next to each other and swapping
them if they are in the wrong order.”
a. Bubble sort
b. Merge sort
c. Insertion sort
d. Linear search
Q5. Analyse the flowchart below. Which algorithm does this represent?
Page 2 Last updated: 29/09/2021
KS4 – Algorithms Summative assessment – Answers
a. Bubble sort
b. Merge sort
c. Linear search
d. Binary search
Q6. A sample of data is shown below:
Frozen Cats Aladdin Moana Grease Annie
A. What order will the data be after the first pass of a bubble sort?
a. Cats, Frozen, Aladdin, Moana, Annie, Grease
b. Cats, Frozen, Aladdin, Moana, Grease, Annie
c. Cats, Aladdin, Frozen, Grease, Annie, Moana
d. Cats, Aladdin, Frozen, Annie, Grease, Moana
Page 3 Last updated: 29/09/2021
KS4 – Algorithms Summative assessment – Answers
B. What order will the data be after the third pass of a bubble sort?
a. Aladdin, Cats, Frozen, Moana, Grease, Annie
b. Aladdin, Cats, Annie, Frozen, Grease, Moana
c. Aladdin, Annie, Cats, Frozen, Grease, Moana
d. Aladdin, Annie, Cats, Grease, Frozen, Moana
Q7. A sample of data is shown below:
Dalí Matisse Sanzio Picasso Munch Renoir
A. When applying a merge sort to this data, which items would be in the two groups
after the split?
Group 1 Dalí, Matisse, Sanzio
Group 2 Picasso, Munch, Renoir
B. What would the groups contain after a second split?
Group 1 Dalí, Matisse
Group 2 Sanzio
Group 3 Picasso, Munch
Group 4 Renoir
Q8. Select all the statements that are true:
❏ Linear search can only be performed on unsorted data
✓ Binary search can only be performed on sorted data
❏ Linear search uses floor division to find the midpoint of the list
❏ Bubble sort is always more efficient than insertion sort
✓ Merge sort is a divide and conquer algorithm
Q9. Read the Python program below:
1 def an_algorithm(items):
2 num_items = len(items)
3 i = 1
Page 4 Last updated: 29/09/2021
KS4 – Algorithms Summative assessment – Answers
4 while i < num_items:
5 for current in range(num_items - 1):
6 if items[current] > items[current+1]:
7 temp = items[current]
8 items[current] = items[current+1]
9 items[current+1] = temp
10 i = i + 1
A. Complete the trace table below only for lines 7-9 of the algorithm. The first line in
the trace table contains the values for the current variable and the items list.
items
Line current temp [0] [1] [2] [3]
0 - Pakistan China Greece Chad
7 Pakistan
8 China China Greece Chad
9 China Pakistan Greece Chad
B. What algorithm is this?
Bubble sort
C. If items is a list of 10 elements, how many comparisons would be made on line 6
during the first iteration of the outer while loop?
D. The number of comparisons is currently the same during each pass of the inner
for loop on line 5. One improvement to the algorithm would be to reduce the
number of comparisons made during each pass.
Explain how you would implement this improvement in the Python program.
The range of the for loop could be changed to num_items - i so that the number of
comparisons is reduced by one after each pass.
Page 5 Last updated: 29/09/2021
KS4 – Algorithms Summative assessment – Answers
Resources are updated regularly — the latest version is available at: ncce.io/tcc.
This resource is licensed under the Open Government Licence, version 3. For more information on this
licence, see ncce.io/ogl.
Page 6 Last updated: 29/09/2021