Single lesson · Written for OCR A Level (H446)

Insertion sort – OCR A Level Computer Science lesson (H446)

Students learn to trace and write an insertion sort, and explain why it is fast on data that is nearly in order.

Also in a bundle Searching, Sorting and Recursion – OCR A Level Computer Science lessons (H446) 15 lessons for £45 · save 25% on buying separately

Lesson 6 of 15 in unit 12.4 Searching, Sorting and Recursion, taught in Year 12, Autumn 2. It answers one big question: How does insertion sort place each item in order?

By the end, students can trace and write an insertion sort, and explain why it is fast on data that is nearly in order.

The Build (the main task)
Write an insertion sort in Python and OCR pseudocode that puts the track lengths (in seconds) of a Tidewave Audio playlist into ascending order (6 marks).
Support version
A trace table for [214, 187, 245, 160] with the first pass completed, and the code with the inner WHILE condition given.
Challenge
Explain why insertion sort is a good choice for Tidewave Audio's weekly chart, which changes by only a few places each week (4 marks).
Real-world link
A Tidewave Audio listener's playlist sorted by track length for a 'fit my commute' feature.
Key words
Insertion sort, Sorted sublist and Insert, each with a definition, an icon and a common mix-up on the key vocabulary slide.
Misconceptions it tackles
“Insertion sort compares and swaps neighbouring pairs across the list, like bubble sort”; “Items in the sorted sublist are in their final positions”.
OCR H446 specification
2.3.1 (a); (f).

Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.

Students need computers for the main task.

Also sold in the Searching, Sorting and Recursion unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.

An independent resource written for OCR A Level Computer Science (H446). It is not endorsed by OCR or Cambridge University Press & Assessment. Programming project (NEA) lessons teach general skills on a made-up example project and give supervised time, within JCQ's rules on the help a centre may give.

What's included

  • Slide deck (PowerPoint)
  • Lesson plan (Word)
  • Worksheet (Word)
  • Support worksheet with scaffolds (Word)
  • Single-teacher licence: use and adapt it with your own classes

More for A Level Computer Science

See all

Written for the specifications named. Not endorsed by or affiliated with any exam board.