Binary search – OCR GCSE Computer Science lesson (J277)
Pupils learn to carry out a binary search on an ordered list, showing the midpoint and the half thrown away at each step, and compare it with a linear search.
Lesson 8 of 11 in unit 10.5 Networks and Searching, taught in Year 10, Summer 1. It answers one big question: How can a sorted list be searched in far fewer steps?
By the end, pupils can carry out a binary search on an ordered list, showing the midpoint and the half thrown away at each step, and compare it with a linear search.
- The Build (the main task)
- Complete a binary search for book ID 4810 in the ordered list of 15 catalogue IDs, writing the midpoint and the part of the list kept at each step; then state how many items a linear search would check.
- Support version
- Part-filled table: the first midpoint is worked out and the kept half is shaded; pupils complete the remaining steps.
- Challenge
- Work out the largest number of items a binary search checks in an ordered list of 1,000 books, and explain why.
- Real-world link
- The catalogue lists every book in ID order, so a librarian can find any one of 60,000 books in a few checks.
- Key words
- Binary search, Midpoint and Ordered, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “Binary search works on any list”; “When a list has an even number of items, the midpoint is halfway between two items, or you round up”.
- OCR J277 specification
- 2.1.3 (searching algorithms: how linear search and binary search work, the steps of each, and what a binary search needs (an ordered list)).
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 can do it all on paper.
Also sold in the Networks and Searching 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 allPupils learn to define a LAN and a WAN, give two differences between them and decide which a given network is.
Free sample lessonPupils learn to complete a trace table for an algorithm with a loop and selection, recording every change to each variable and the output.
Pupils learn to explain how bandwidth, latency, the number of users, the transmission media, errors and interference affect network performance.
Written for the specifications named. Not endorsed by or affiliated with any exam board.