Skip to content
Computer Science · Grade 10

Active learning ideas

Searching Algorithms (Linear & Binary)

Students grasp searching algorithms best by acting them out rather than just reading about them. Moving from abstract theory to hands-on tracing and testing helps them internalize how each algorithm scans data. Active methods make invisible steps visible, turning confusion into clarity.

Ontario Curriculum ExpectationsCS.HS.A.3CS.HS.A.4
15–35 minPairs → Whole Class4 activities

Activity 01

Simulation Game35 min · Pairs

Pairs Coding: Build and Test Searches

Pairs write linear and binary search functions in Python or pseudocode. Test on unsorted and sorted lists of 20, 200, and 2000 elements, counting steps or using time functions. Pairs graph results and present one insight to class.

Compare the efficiency of linear search versus binary search.

Facilitation TipDuring Pairs Coding, remind students to print or log each comparison so they can trace mismatches between their code and the algorithm's intention.

What to look forProvide students with a small, unsorted list of numbers and a target number. Ask them to manually trace the steps of a linear search, writing down each comparison made. Then, ask them to explain why binary search would not work on this specific list.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 02

Simulation Game30 min · Small Groups

Small Groups: Card Deck Simulations

Provide decks of numbered cards, some sorted, some shuffled. Groups perform linear searches on shuffled decks and binary on sorted ones, recording steps per search. Switch decks and compare averages as group sizes grow.

Analyze when to apply each searching algorithm based on data characteristics.

Facilitation TipDuring Card Deck Simulations, circulate with a timer to keep rotations tight; this prevents students from lingering on solved cases.

What to look forPose the following scenario: 'You have a list of 1000 student IDs and need to find a specific ID. Would you prefer to use linear search or binary search? Justify your answer by explaining the characteristics of the data and the algorithms.'

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 03

Simulation Game20 min · Whole Class

Whole Class: Live Visualization Race

Display a large sorted list on screen. Class votes predictions on steps for linear versus binary to find a target. Run step-by-step animations for both, tally class predictions versus actuals, discuss surprises.

Construct a simple searching algorithm to find an element in a list.

Facilitation TipDuring the Live Visualization Race, assign roles clearly: one student calls out steps, another records comparisons, and a third tracks time.

What to look forOn an index card, have students write down one key difference between linear and binary search. Then, ask them to provide one example of when they would choose linear search over binary search.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 04

Simulation Game15 min · Individual

Individual: Use Case Analysis

Students get scenarios like phonebooks or playlists. Decide and sketch linear or binary search, justify with efficiency reasons. Share one via exit ticket for class review next lesson.

Compare the efficiency of linear search versus binary search.

Facilitation TipDuring Individual Use Case Analysis, require students to cite real-world examples they’ve experienced to ground their reasoning.

What to look forProvide students with a small, unsorted list of numbers and a target number. Ask them to manually trace the steps of a linear search, writing down each comparison made. Then, ask them to explain why binary search would not work on this specific list.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

A few notes on teaching this unit

Start with the simplest case: a short unsorted list where linear search is the only option. Use that as a stepping stone to sorting and binary search. Avoid rushing to optimization—let students feel the pain of inefficient searches first. Research shows concrete examples first, abstractions second, so build from manual traces to code.

Students will confidently explain when to use linear versus binary search, justify their choices with data scale and list properties, and spot common errors in real time. Their explanations will show they connect algorithm mechanics to practical outcomes.


Watch Out for These Misconceptions

  • During Card Deck Simulations, watch for students who assume binary search works on any deck without sorting.

    Hand each group a shuffled deck and ask them to perform binary search anyway, then reflect in their group why it fails. They’ll notice the mid-point points to the wrong half, leading to a class discussion on sorting first.

  • During Pairs Coding, watch for students who claim linear search is always slower even for very small lists.

    Have each pair run their linear search code on a list of 5 items and compare runtimes to their binary search implementation. The overhead of sorting in binary might make linear faster, prompting a class tally of when simplicity wins.

  • During Live Visualization Race, watch for students who dismiss efficiency as irrelevant due to fast computers.

    In the last race, use a list of one million items projected live; students will see the linear search crawl while binary zooms. Use this visceral moment to anchor their understanding of scale and timing constraints.


Methods used in this brief