Back to Activities

Ready-to-use computing activity

Algorithm Race

GCSE50-60 minutesAlgorithm Visualiser

Teacher overview

Prior knowledge: Learners should understand that algorithms can be compared using the same input data.

Learning objective: Compare search and sorting algorithms using observed comparisons, swaps and trace evidence.

Starter

Which do you think will use fewer comparisons on [2, 4, 6, 8, 10]: linear search or binary search?

Main task

  1. Predict which algorithm will finish first on the given data.
  2. Run linear search and binary search for the same present target.
  3. Record comparisons and result.
  4. Run bubble sort and insertion sort on the same reverse-sorted data.
  5. Use evidence to write a short conclusion.

Support prompts

  • Keep the data the same for a fair comparison.
  • Do not use binary search until the data is sorted.
  • A swap count is not the same as a comparison count.

Challenge

Find a data set where insertion sort does very little work.

Plenary or exit question

Why is fastest on one data set not the same as always fastest?

Related tool

Open Algorithm Visualiser