Skip to content
Computing · Secondary 4

Active learning ideas

Analyzing Algorithm Efficiency: Step Counting

Active tracing makes abstract efficiency concepts visible for students. When learners physically mark comparisons or count loops in real time, they see how steps grow differently across algorithms and datasets. This hands-on work replaces guesswork with clear patterns they can explain and defend.

MOE Syllabus OutcomesMOE: Algorithms - S4MOE: Computational Thinking - S4
25–45 minPairs → Whole Class4 activities

Activity 01

Problem-Based Learning35 min · Pairs

Pair Trace-Off: Linear vs Binary Search

Provide pairs with sorted number cards and unsorted lists. One student traces linear search steps aloud, counting comparisons; the partner does binary search. They swap roles, tally totals, and graph results for n=10 and n=20. Discuss patterns in a 5-minute share-out.

Explain how counting steps helps us understand an algorithm's efficiency.

Facilitation TipDuring Pair Trace-Off, have students alternate roles as tracer and recorder every two steps to keep both engaged.

What to look forProvide students with a small, sorted list (e.g., 8 numbers) and a target value. Ask them to trace the steps of a binary search, writing down each comparison made and the final step count. Then, ask them to do the same for a linear search and compare the counts.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Problem-Based Learning45 min · Small Groups

Small Group Scaling Predictions

Groups receive algorithm pseudocode for bubble sort and selection sort. Predict step counts for input sizes 5, 10, 20; trace the smallest to verify. Plot predictions on shared graphs and adjust based on actual traces. Compare group graphs class-wide.

Compare the number of steps taken by linear search versus binary search for a given dataset size.

Facilitation TipFor Small Group Scaling Predictions, provide calculators to avoid arithmetic slowing the conceptual work.

What to look forGive students a simple pseudocode snippet for a loop that iterates N times. Ask them to count the number of operations inside the loop and write an expression for the total steps based on N. For example, if the loop body has 3 operations, the total steps would be 3*N.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning40 min · Small Groups

Whole Class Physical Search Relay

Divide class into teams with card decks representing datasets. Teams race to find a target using linear or binary search rules, counting steps per relay member. Record team totals, then analyze why binary teams finish faster for larger decks.

Predict how the number of steps in a simple algorithm changes as the input size increases.

Facilitation TipIn the Whole Class Physical Search Relay, set a three-minute timer per round to maintain momentum and pressure.

What to look forPose this question: 'Imagine you have a list of 1000 items. Would you prefer to use linear search or binary search if the list is sorted? Explain your answer by referring to the typical number of steps each algorithm would take.'

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Problem-Based Learning25 min · Individual

Individual Algorithm Auditor

Students pick a simple loop-based algorithm from notes. Trace it solo for three input sizes, count steps in a table, and predict for n=100. Pair up briefly to verify counts and refine predictions.

Explain how counting steps helps us understand an algorithm's efficiency.

Facilitation TipAssign the Individual Algorithm Auditor role only after students have practiced together; solo work reveals gaps in shared understanding.

What to look forProvide students with a small, sorted list (e.g., 8 numbers) and a target value. Ask them to trace the steps of a binary search, writing down each comparison made and the final step count. Then, ask them to do the same for a linear search and compare the counts.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teachers should model step counting aloud with think-alouds, especially when loops or nested conditions appear. Avoid rushing to formulas; let students derive the relationship between input size and steps before introducing Big O notation. Research shows that students grasp efficiency best when they first see the raw counts and only later abstract them into general rules.

Successful learning looks like students tracing searches step-by-step, quantifying operations, and justifying why one algorithm scales better than another. They should use data to compare growth rates, predict behavior on larger inputs, and articulate trade-offs between sorted and unsorted data.


Watch Out for These Misconceptions

  • During Pair Trace-Off, watch for students assuming both searches take similar steps on larger lists.

    Have pairs recount steps on 16-item and 32-item lists, then graph the results side by side to expose linear versus logarithmic growth.

  • During Pair Trace-Off, watch for students applying binary search to unsorted data without noticing it fails.

    After they try, hand them a small unsorted deck of cards and ask them to sort it first, then count the steps binary search would take if forced to run; they will see extra operations appear.

  • During Individual Algorithm Auditor, watch for students equating fewer lines of code with fewer executed steps.

    Give each student a snippet with a single loop that spans two lines but runs N times; have them tally the loop body operations to reveal the hidden repetitions.


Methods used in this brief