Single lesson · Written for OCR J277

Bubble sort – OCR GCSE Computer Science lesson (J277)

Pupils learn to carry out a bubble sort pass by pass, showing each comparison and swap, and state when the algorithm stops.

Also in a bundle Protocols and Sorting – OCR GCSE Computer Science lessons (J277) 11 lessons for £39 · save 11% on buying separately

Lesson 2 of 11 in unit 10.6 Protocols and Sorting, taught in Year 10, Summer 2. It answers one big question: How does a bubble sort put a list in order?

By the end, pupils can carry out a bubble sort pass by pass, showing each comparison and swap, and state when the algorithm stops.

The Build (the main task)
Complete a bubble sort of the eight tournament scores 34, 12, 56, 7, 41, 23, 60, 18 into ascending order, writing the list after each pass and the number of swaps in each pass.
Support version
Part-filled pass table: pass 1 is done comparison by comparison, and the start of pass 2 is given.
Challenge
State the number of comparisons in each pass and explain why a ninth pass would never be needed.
Real-world link
The tournament's round 1 scores arrive in a random order and the leaderboard must show them in order.
Key words
Bubble sort, Pass and Swap, each with a definition, an icon and a common mix-up on the key vocabulary slide.
Misconceptions it tackles
“A bubble sort stops after one pass”; “A pass is one swap”.
OCR J277 specification
2.1.3 (sorting algorithms: the main steps of bubble sort, merge sort and insertion sort, applying each to a data set and recognising each from its code); 2.2 (programming fundamentals, data types and additional techniques, used together in a planned programming project (arrays, loops, selection, swapping values)).

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.

Pupils need computers for the main task.

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

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 GCSE Computer Science (OCR)

See all

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