Skip to content
Menu

Year 9 (ages 13–14, Grade 8 in the US) · Computing · Algorithms · Lesson 4

Merge sort and comparing algorithms

Merge sort as divide and conquer, splitting and merging lists, and comparing bubble sort and merge sort for speed, memory and ease.

Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

Whiteboard video lesson: Merge sort and comparing algorithms

17-minute video lesson

Teaching, worked examples and 20 practice questions solved step by step.

Watch free for a month

What your child will learn

  • Describe merge sort
  • Split and merge lists
  • Compare sorting algorithms
  • Choose a suitable algorithm

The method

  1. Split in half until single items.
  2. Merge pairs: take the smaller front item each time.
  3. Repeat until one list.
  4. Compare: speed, memory, ease.

Key words: merge sort, divide and conquer, merge, efficiency, trade-off.

Worked examples

Worked examples from the lesson, with every step.

Question 1

Merge the sorted lists [1, 5] and [2, 3] into one sorted list.

  1. Step 1: compare the front of each list; take the smaller
  2. Step 2: 1, 2, 3, 5

Answer: [1, 2, 3, 5]

Question 2

Merge the sorted lists [3, 9] and [4, 6] into one sorted list.

  1. Step 1: compare the front of each list; take the smaller
  2. Step 2: 3, 4, 6, 9

Answer: [3, 4, 6, 9]

Question 3

Merge the sorted lists [2, 7] and [1, 8] into one sorted list.

  1. Step 1: compare the front of each list; take the smaller
  2. Step 2: 1, 2, 7, 8

Answer: [1, 2, 7, 8]