Skip to content
Computing · Year 9

Active learning ideas

Sorting Algorithms: Bubble Sort

Active learning works well for bubble sort because it turns abstract comparisons and swaps into concrete, visible actions. Students physically moving cards or tracing steps with their fingers helps them internalise how elements ‘bubble’ into place over repeated passes.

National Curriculum Attainment TargetsKS3: Computing - AlgorithmsKS3: Computing - Computational Thinking
25–40 minPairs → Whole Class4 activities

Activity 01

Simulation Game30 min · Small Groups

Hands-On: Physical Card Sort

Give small groups shuffled number cards representing an array. Students stand in a line mimicking the array, then perform bubble sort passes by comparing and swapping positions aloud. They record swap counts per pass on a shared whiteboard.

Explain the process of bubble sort using a small set of numbers.

Facilitation TipDuring Physical Card Sort, circulate and ask each pair to verbalise why they swapped two cards after each pass.

What to look forProvide students with a small unsorted list, such as [7, 2, 5, 1]. Ask them to trace the first pass of bubble sort, showing each comparison and swap. Then, ask them to count the total number of comparisons made in this pass.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 02

Simulation Game25 min · Pairs

Pair Trace: Step-by-Step Walkthrough

Pairs receive worksheets with unsorted arrays. They trace bubble sort iterations in tables, marking comparisons and swaps with colours. Pairs then swap worksheets to check each other's traces against a model solution.

Evaluate the efficiency of bubble sort compared to simply re-ordering items manually.

Facilitation TipIn Pair Trace, require students to annotate each comparison and swap on a printed worksheet before moving to the next step.

What to look forPose the question: 'Imagine you have a list of 1000 numbers that are already sorted. How many comparisons would bubble sort make? Now, imagine the list is sorted in reverse. How would the number of comparisons change, and why?' Facilitate a discussion on the best and worst-case scenarios.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 03

Simulation Game40 min · Pairs

Code Challenge: Implement and Test

In pairs, students pseudocode bubble sort first, then code it in Python or Scratch. They test with provided arrays, count comparisons using print statements, and modify for early exit if sorted.

Predict how the number of comparisons changes as the list size increases in a bubble sort.

Facilitation TipIn Code Challenge, provide a starter code with comments that block out the swap line—students fill this in to reinforce the exact comparison and swap logic.

What to look forGive each student a list of 5 numbers. Ask them to write down the final sorted list after bubble sort is applied. Then, ask them to write one sentence explaining why bubble sort is not suitable for sorting millions of items.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 04

Simulation Game35 min · Whole Class

Whole Class: Efficiency Race

Divide class into teams; one team does bubble sort on cards, another manual sort. Time both, then discuss comparison counts. Use projector to simulate larger arrays digitally.

Explain the process of bubble sort using a small set of numbers.

Facilitation TipDuring Efficiency Race, have students record the number of comparisons for each list size on a shared whiteboard to compare growth patterns.

What to look forProvide students with a small unsorted list, such as [7, 2, 5, 1]. Ask them to trace the first pass of bubble sort, showing each comparison and swap. Then, ask them to count the total number of comparisons made in this pass.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

A few notes on teaching this unit

Teachers often start with physical sorting to ground the algorithm in real movement, then transition to tracing and coding to build fluency. Avoid rushing to the code; ensure students can articulate each swap before writing loops. Research shows that early concrete experiences reduce errors when students later implement the algorithm in code.

Successful learning looks like students tracing passes correctly, explaining why multiple passes are needed, and evaluating bubble sort’s efficiency with growing list sizes. They should confidently describe the role of adjacent swaps and predict comparison counts.


Watch Out for These Misconceptions

  • During Physical Card Sort, watch for students stopping after one pass and declaring the list sorted.

    Stop the group after the first pass and ask them to count how many elements are in their final position. Have them explain why inner elements may still be out of order.

  • During Pair Trace, watch for students swapping non-adjacent cards or skipping unlabeled elements.

    Circulate and point to the adjacent pair rule on the worksheet. Ask students to read the rule aloud and trace only the current adjacent pair before deciding to swap.

  • During Efficiency Race, watch for students assuming bubble sort handles large lists efficiently.

    After charting results, ask students to estimate comparisons for a list of 1000 items using the quadratic pattern they observed on smaller lists.


Methods used in this brief