# Bubble sort

This lesson introduces learners to the first sorting algorithm in this unit: bubble sort. They will discuss why and where sorting is used in real life, become familiar with performing a bubble sort on a set of data, and investigate the efficiency of bubble sort.

Quiz:

# Intro quiz - Recap from previous lesson

Before we start this lesson, let’s see what you can remember from this topic. Here’s a quick quiz!

## Question 4

Q1.The sequence of items in the list can either be ordered or unordered.

1/4

Q2.If you double the number of items in the list, you will need at most one more comparison.

2/4

Q3.The algorithm is simpler to write.

3/4

Q4.What does the initial value of -1 indicate?

4/4

Quiz:

# Intro quiz - Recap from previous lesson

Before we start this lesson, let’s see what you can remember from this topic. Here’s a quick quiz!

## Question 4

Q1.The sequence of items in the list can either be ordered or unordered.

1/4

Q2.If you double the number of items in the list, you will need at most one more comparison.

2/4

Q3.The algorithm is simpler to write.

3/4

Q4.What does the initial value of -1 indicate?

4/4

# Video

Click on the play button to start the video. If your teacher asks you to pause the video and look at the worksheet you should:

• Click "Close Video"
• Click "Next" to view the activity

Your video will re-appear on the next page, and will stay paused in the right place.

# Worksheet

These slides will take you through some tasks for the lesson. If you need to re-play the video, click the ‘Resume Video’ icon. If you are asked to add answers to the slides, first download or print out the worksheet. Once you have finished all the tasks, click ‘Next’ below.

Quiz:

# Bubble Sort

This quiz is to assess your learning from this lesson. Read the description below and select which term it is referring to:

## Question 3

Q1."If the item at the current position is greater than the one next to it, swap the items within the list"

1/3

Q2."A single pass results in the smallest element reaching its final position at the end of the list"

2/3

Q3."The number of comparisons made in a single pass is always equal to the number of pairs you pass over"

3/3

Quiz:

# Bubble Sort

This quiz is to assess your learning from this lesson. Read the description below and select which term it is referring to:

## Question 3

Q1."If the item at the current position is greater than the one next to it, swap the items within the list"

1/3

Q2."A single pass results in the smallest element reaching its final position at the end of the list"

2/3

Q3."The number of comparisons made in a single pass is always equal to the number of pairs you pass over"

3/3

# Lesson summary: Bubble sort

## Time to move!

Did you know that exercise helps your concentration and ability to learn?

For 5 mins...

Move around:
Climb stairs

On the spot:
Chair yoga