Insertion sort

In this lesson, learners will explore another sorting algorithm: insertion sort. Some exam boards do not require learners to know insertion sort, so do check the specification first. Learners will start by discussing how they would sort objects in real life, which may lead them to describe something akin to an insertion 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 1

Question 2

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:

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 1

Question 2

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

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:

Insertion Sort

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

Question 1

Question 2

Question 3

Question 4

Question 5

Question 6

Question 7

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

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:

Question 1

Question 2

Question 3

Question 4

Question 5

Question 6

Question 7

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 attempted both the quizzes.

To share your results with your teacher please complete both the quizzes.

Browse Oak's lessons: