Insertion sort

In this lesson, we will explore another sorting algorithm: insertion sort. Some exam boards do not require learners to know insertion sort, so do check the specification first. We will start by discussing how to sort objects in real life, which will help us to describe something akin to an insertion sort.

This quiz includes images that don't have any alt text - please contact your teacher who should be able to help you with an audio description.

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!

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

This quiz includes images that don't have any alt text - please contact your teacher who should be able to help you with an audio description.

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!

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

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.

This quiz includes images that don't have any alt text - please contact your teacher who should be able to help you with an audio description.

Quiz:

Insertion Sort

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

Q1."The insertion sort algorithm works by grouping the items in a list into two parts: a sorted sublist and an unsorted sublist."

1/7

Q2."With each pass through the list, an item from the unsorted sublist is compared to items in the sorted sublist until it is inserted into the correct position."

2/7

Q3."If the item at the current position is greater than value, copy it into the next item and move on to the previous item in the list"

3/7

Q4."Insertion sort compares an item from the unsorted sublist with the items in the sorted sublist and places it in the correct position."

4/7

Q5."Insertion sort is usually slower to execute than bubble sort on large, unordered data sets."

5/7

Q6."Insertion sort is usually slower to execute than bubble sort on large, unordered data sets."

6/7

Q7."During a pass of an insertion sort, elements in the sorted part of the list are copied into the next position, to make space for the value to be inserted."

7/7

This quiz includes images that don't have any alt text - please contact your teacher who should be able to help you with an audio description.

Quiz:

Insertion Sort

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

Q1."The insertion sort algorithm works by grouping the items in a list into two parts: a sorted sublist and an unsorted sublist."

1/7

Q2."With each pass through the list, an item from the unsorted sublist is compared to items in the sorted sublist until it is inserted into the correct position."

2/7

Q3."If the item at the current position is greater than value, copy it into the next item and move on to the previous item in the list"

3/7

Q4."Insertion sort compares an item from the unsorted sublist with the items in the sorted sublist and places it in the correct position."

4/7

Q5."Insertion sort is usually slower to execute than bubble sort on large, unordered data sets."

5/7

Q6."Insertion sort is usually slower to execute than bubble sort on large, unordered data sets."

6/7

Q7."During a pass of an insertion sort, elements in the sorted part of the list are copied into the next position, to make space for the value to be inserted."

7/7

Lesson summary: Insertion sort

It looks like you have not completed one of the quizzes.

To share your results with your teacher please complete one of the quizzes.

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:
Dance

The next lesson in:
Algorithms
is:
Coding sorting algorithms

Browse Oak's lessons: