Skip to content
Computer Science · Grade 10

Active learning ideas

Sorting Algorithms (Selection & Bubble)

Active learning works well for sorting algorithms because the step-by-step nature of these processes is best understood through physical and visual engagement. When students manipulate objects or trace processes themselves, they internalize how each comparison and swap contributes to the final sorted array, making abstract time complexity concepts concrete.

Ontario Curriculum ExpectationsCS.HS.A.3CS.HS.A.4
25–45 minPairs → Whole Class4 activities

Activity 01

Experiential Learning35 min · Small Groups

Hands-On: Bubble Sort Cards

Provide decks of numbered cards to small groups. Students line up cards, perform passes by comparing and swapping adjacent pairs aloud, and record swaps per pass. Discuss when the sort completes. Extend by timing sorts of 10 versus 20 cards.

Explain the step-by-step process of selection sort and bubble sort.

Facilitation TipBefore Bubble Sort Cards, give each pair a small deck of numbered index cards and ask them to predict how many passes they think it will take to sort the deck completely.

What to look forProvide students with a small unsorted array (e.g., [5, 1, 4, 2]). Ask them to trace the steps of selection sort on paper, showing the array after each pass and counting the total number of swaps. Then, ask them to do the same for bubble sort.

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 02

Experiential Learning25 min · Pairs

Partner Tracing: Selection Sort

Pairs receive printed arrays on worksheets. One student reads array values while the partner identifies the minimum in the unsorted section and simulates the swap. Switch roles after each pass, then verify the final sorted array together.

Analyze the time complexity of basic sorting algorithms.

Facilitation TipFor Partner Tracing: Selection Sort, provide colored pencils so students can highlight the sorted and unsorted portions of the array after each pass.

What to look forPose the question: 'Imagine you are sorting a list of student names alphabetically. If two students have the same last name, should their relative order matter? Which sorting algorithm (selection or bubble) would you choose if you wanted to guarantee their original order is maintained, and why?'

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 03

Experiential Learning45 min · Small Groups

Efficiency Race: Algorithm Showdown

Whole class divides into teams. Teams manually sort arrays of increasing sizes using selection or bubble sort while a timer runs. Chart comparisons and swaps, then predict results for n=50. Debrief on O(n²) growth.

Differentiate between stable and unstable sorting algorithms.

Facilitation TipDuring Efficiency Race: Algorithm Showdown, set a timer for 2 minutes and have students record both swap counts and operation counts for each algorithm to compare visibly on the board.

What to look forOn an index card, have students write down the Big O time complexity for both selection sort and bubble sort. Then, ask them to explain in one sentence why these algorithms are considered inefficient for very large datasets.

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 04

Experiential Learning40 min · Individual

Code vs Manual: Hybrid Sort

Individuals code one algorithm in Python or pseudocode, test on sample arrays. Then, in pairs, compare runtime outputs to prior manual timings. Adjust code to visualize passes with print statements.

Explain the step-by-step process of selection sort and bubble sort.

Facilitation TipIn Code vs Manual: Hybrid Sort, ask students to prepare a short reflection on which method felt more intuitive for them and why.

What to look forProvide students with a small unsorted array (e.g., [5, 1, 4, 2]). Ask them to trace the steps of selection sort on paper, showing the array after each pass and counting the total number of swaps. Then, ask them to do the same for bubble sort.

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

A few notes on teaching this unit

Teachers approach this topic by first emphasizing the importance of tracing algorithms manually before moving to code. Students often grasp the logic better when they physically perform the steps, so avoid rushing to implementation. Research shows that concrete examples reduce cognitive load when introducing abstract concepts like time complexity. Encourage students to verbalize each step as they work to reinforce understanding.

By the end of these activities, students will trace both selection and bubble sort algorithms independently, accurately count operations, and explain why both have O(n²) time complexity. They will also recognize when stability matters in sorting and justify algorithm choice based on context.


Watch Out for These Misconceptions

  • During Bubble Sort Cards, watch for students who believe the sort completes after one pass through the deck.

    Pause the activity after the first pass and ask students to recount swaps and explain why the array might still be unsorted, reinforcing that multiple passes are needed until no swaps occur.

  • During Efficiency Race: Algorithm Showdown, watch for students who assume selection sort always performs fewer total operations than bubble sort.

    Have students tally swaps and comparisons separately for each algorithm during the race and compare totals side by side to see that neither consistently dominates the other.

  • During Hands-On: Bubble Sort Cards, watch for students who dismiss stability as irrelevant because all elements are unique in their examples.

    Introduce a second set of cards with duplicate values (e.g., two 3s) and ask students to sort them, then observe whether their original order is preserved to highlight stability's importance.


Methods used in this brief