Skip to content
Computing · Year 11

Active learning ideas

Sorting Algorithms: Bubble and Insertion Sort

Active learning helps students grasp sorting algorithms because tracing passes and physical card movements make abstract comparisons and shifts visible. When students implement bubble and insertion sort themselves, they see how small changes in data order affect performance, which builds deeper understanding than reading or listening alone.

National Curriculum Attainment TargetsGCSE: Computing - AlgorithmsGCSE: Computing - Computational Thinking
20–40 minPairs → Whole Class4 activities

Activity 01

Problem-Based Learning30 min · Pairs

Pair Programming: Bubble Sort Implementation

Pairs write bubble sort in pseudocode or Python, test on lists of 5-10 numbers, and log swaps per pass. Switch roles midway. Compare results against a sorted list to spot early termination.

Analyze the number of comparisons and swaps required by Bubble Sort for a nearly sorted list.

Facilitation TipDuring Pair Programming: Bubble Sort Implementation, circulate and ask pairs to verbalize their swap decisions step-by-step to catch off-by-one errors early.

What to look forProvide students with a small, unsorted list of numbers (e.g., 5 elements). Ask them to write down the number of comparisons and swaps required by Bubble Sort to sort this list. Then, ask them to identify the best-case input for Insertion Sort and explain why.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Problem-Based Learning40 min · Small Groups

Small Groups: Insertion Sort Card Challenge

Groups receive shuffled cards numbered 1-20. Perform insertion sort by building sorted pile, timing the process. Rotate roles: inserter, timer, observer. Graph times for random versus nearly sorted decks.

Differentiate between the best-case and worst-case scenarios for Insertion Sort.

Facilitation TipIn Small Groups: Insertion Sort Card Challenge, provide decks with color-coded ends so students quickly spot nearly sorted sections to reinforce best-case scenarios.

What to look forGive each student a dataset (e.g., [3, 1, 4, 2]). Ask them to complete a trace table for Bubble Sort, showing the state of the list after each pass. On the back, they should write one sentence explaining the primary difference in how Bubble Sort and Insertion Sort approach the sorting task.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning25 min · Whole Class

Whole Class: Trace Table Relay

Project a dataset; class divides into teams. One student per team fills one row of the trace table on whiteboard, passes marker. First accurate table wins. Debrief on common errors.

Construct a trace table to demonstrate the execution of Bubble Sort on a given dataset.

Facilitation TipIn Whole Class: Trace Table Relay, assign roles like ‘comparer’ and ‘recorder’ to ensure every student contributes to the shared table.

What to look forPose the question: 'Imagine you have a list of 1000 items that is already sorted. Which algorithm, Bubble Sort or Insertion Sort, would perform better and why?' Facilitate a class discussion where students justify their answers using concepts like best-case scenarios and number of operations.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Problem-Based Learning20 min · Individual

Individual: Efficiency Comparison Sheets

Students trace bubble and insertion on three datasets (sorted, random, reverse). Tally operations in tables. Plot bars to visualize differences. Share one insight with neighbor.

Analyze the number of comparisons and swaps required by Bubble Sort for a nearly sorted list.

What to look forProvide students with a small, unsorted list of numbers (e.g., 5 elements). Ask them to write down the number of comparisons and swaps required by Bubble Sort to sort this list. Then, ask them to identify the best-case input for Insertion Sort and explain why.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teach sorting algorithms by alternating concrete card work with abstract tracing to bridge the gap between action and notation. Avoid rushing to code—let students feel the ‘shift’ in insertion sort and the ‘bubble’ in bubble sort first. Research shows that students who physically manipulate data before tracing retain concepts longer and make fewer off-by-one errors.

Students will confidently trace bubble and insertion sort on small datasets, counting comparisons and swaps accurately. They will explain when each algorithm performs best and why, using concrete examples from their trace tables and card sorting activities.


Watch Out for These Misconceptions

  • During Pair Programming: Bubble Sort Implementation, watch for students assuming bubble sort always needs the maximum number of passes.

    Use the pre-written early-termination condition in the starter code to show how the algorithm checks for swaps and stops early on nearly sorted data, then have pairs modify their loop to test this behavior.

  • During Small Groups: Insertion Sort Card Challenge, watch for students performing adjacent swaps instead of shifting elements to make space.

    Have students physically slide cards rightward to create space for the new element, then write the corresponding array state after each shift to connect the action to the algorithm.

  • During Whole Class: Trace Table Relay, watch for students believing insertion sort requires as many operations in the best case as in the worst case.

    Assign one team the sorted dataset and have them race through the relay, highlighting that only n-1 comparisons occur, then contrast this with a reverse-sorted team’s full trace to make the difference visible.


Methods used in this brief