wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Sorting Algorithm

Total questions: 25

Worksheet time: 19mins

Name
Class
Date
1.
Which sorting algorithm makes one swap per pass (possibly swapping an element with itself)?
a)
Selection Sort
b)
Bubble Sort
c)
Insertion Sort
2.
Which sorting algorithm may make multiple swaps per pass?
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
3.
Which sorting algorithm shifts elements instead of swapping elements if needed in each pass.
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
4.
How many passes will both the selection and insertion sorts make?
a)
N
b)
N-1
c)
N+1
d)
(N+1)/2
5.

The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?

4 5 9 6 2 7


4 5 6 2 7 9

4 5 2 6 7 9

4 2 5 6 7 9

a)

Bubble Sort

b)

Selection Sort

c)

Insertion Sort

6.

The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?

4 5 9 6 2 7


4 5 9 6 2 7

4 5 9 6 2 7

4 5 6 9 2 7

a)

Bubble Sort

b)

Selection Sort

c)

Insertion Sort

7.

The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?

4 5 9 6 2 7


2 5 9 6 4 7

2 4 9 6 5 7

2 4 5 6 9 7

a)

Bubble Sort

b)

Selection Sort

c)

Insertion Sort

8.

We are sorting the following list in ascending order:


1 4 2 9 3 8 5


What does the list look like after one pass of the bubble sort algorithm.

a)

1 2 4 3 8 5 9

b)

1 4 2 5 3 8 9

c)

4 2 9 3 8 5 1

9.

We are sorting the following list in descending order:


1 4 2 9 3 8 5


What does the list look like after one pass of the selection sort algorithm.

a)

1 4 2 9 3 8 5

b)

9 4 2 1 3 8 5

c)

4 2 9 3 8 5 1

10.

We are sorting the following list in ascending order:


1 4 2 9 3 8 5


What does the list look like after one pass of the insertion sort algorithm.

a)

1 4 2 9 3 8 5

b)

4 2 9 3 8 5 1

c)

4 1 2 9 3 8 5

11.

Which of these is not a sorting algorithm?

a)

Bubble

b)

Insertion

c)

Merge

d)

Binary

12.

The following two lists are to be merged, which element first goes into the

new merged list?

List 1: 2 4 8 9

List 2: 1 6 8 4

a)

0

b)

1

c)

2

d)

3

13.

Which sorting algorithm splits a list of items into individual lists?

a)

Merge

b)

Bubble

c)

Insertion

d)

None of these

14.

Which sorting algorithm takes an item from the list, and puts it in the correct place in a sorted list?

a)

Merge

b)

Bubble

c)

Insertion

d)

None of these

15.
Why does a bubble sort do a final pass even when the data is in the correct order?
a)
To save the data
b)
It does not recognise that the data is in order until the final pass requires no changes
c)
It needs to do this to put the data back in to a list
16.
Which of the following is an advantage of a bubble sort?
a)
It is a very small and simple computer program
b)
It takes a very long time to run
c)
It is very quick
17.
Which of the following is NOT an advantage of a bubble sort?
a)
It is a very small and simple computer program
b)
There is only one task to perform
c)
It is very quick
18.
What does an insertion sort do?
a)
Separates a list of data into different collections of data which are sorted and gathered back into a list
b)
Goes through a list of data a number of times and compares two items that are side by side to each other to see which is out of order
c)
Goes through a list, comparing two items that are side by side, and continues to move one value until it is in the correct place.
19.
Which of the following is an advantage of a insertion sort when compared with a bubble sort?
a)
It is quicker than a bubble sort algorithm
b)
It is simpler than a bubble sort algorithm
c)
There is no advantage.
20.
Which type of sort algorithm is this?
a)
Bubble
b)
Merge
c)
Insertion
21.
Which type of sort algorithm is this?
a)
Insertion
b)
Merge
c)
Bubble
22.
Which type of search algorithm is this?
a)
Binary
b)
Linear
23.
Which type of search algorithm is this?
a)
Binary
b)
Linear
24.

What is the most important reason that data needs to be sorted?

a)

It is organised and easier to make sense of.

b)

So it looks nice.

c)

To show we can do it.

25.

Which of the following are sorting algorithms?

a)

Binary, linear

b)

Numerical, phonetic

c)

Bubble, merge

d)

File, alphabetical