Unit bundle · Key Stage 3

Searching and Sorting – Year 9 Computing lessons

Six Year 9 lessons on linear and binary search, bubble sort, insertion and merge sort, comparing algorithms and Bebras practice.

Also in a bundle Year 9 Computing – a full year of KS3 lessons 36 lessons for £89 · save 38% on buying separately

Every time someone searches a library catalogue or sorts an online shop by price, a computer runs a searching or sorting algorithm on thousands of items in a fraction of a second. Building on the lists and functions pupils wrote in 9.1, this unit teaches the key algorithms every programmer knows: linear and binary search, then bubble, insertion and merge sort, coded in Python and traced by hand. Pupils take part in the UK Bebras Challenge, then time the algorithms on a large data set for the school library, so they can explain why some algorithms are far more efficient than others and which one to choose.

Unit 9.2 is taught in Year 9, Autumn 2, and answers one big question: How do computers find and order data so quickly? Every lesson uses the same real-world context (how search engines and online shops find and order results), and pupils make a timed comparison of algorithms on a large data set. The careers link is a software engineer: a software engineer at an online shop or search company chooses and tests the algorithms that find and sort results, timing them on millions of items so customers never wait.

What happens in each lesson:

Lesson 1, Bebras practice: algorithmic puzzles: How can step-by-step thinking crack a puzzle we have never seen? By the end, pupils can use decomposition, pattern recognition and tracing an algorithm step by step to solve Bebras-style algorithmic puzzles and explain their method.

Lesson 2, Bebras Challenge (Intermediates): Which strategy helps me most when a puzzle is unfamiliar? By the end, pupils can complete the 45-minute UK Bebras Challenge (Intermediates) on their own, choosing a strategy for each task.

Lesson 3, Linear and binary search: How can a computer find one item in a huge list? Main task: write a Python function linear_search(books, target) that returns the index of the target title, or -1 if it is not in the list, and test it with one title that is in the list and one that is not.

Lesson 4, Bubble sort: How does a computer sort a list one swap at a time? Main task: complete a bubble sort of six books' loan counts (12, 5, 18, 3, 9, 14) into ascending order. Write the list after every pass and the number of swaps in that pass, then state how you know the list is sorted.

Lesson 5, Insertion or merge sort, and comparing algorithms: Why do some sorting algorithms finish so much faster than others? Main task: compare bubble sort, insertion sort and merge sort using the timing results for 100, 1,000 and 5,000 books, and recommend one for the library catalogue, giving two reasons.

Lesson 6, Progress Check, including coding a search: 14-question check: 13 multiple-choice questions + one applied coding question.

Misconceptions it tackles include
“Binary search works on any list, sorted or not”; “One pass of a bubble sort is enough to sort the list”; “Merge sort is finished once the list has been split into single items”. Each is planned into a hinge question before the main task or an exit question, so you find out who still holds it.

National Curriculum coverage (KS3 computing programme of study): NC2, key algorithms (e.g. searching and sorting); compare alternative algorithms; NC3, two or more languages, at least one textual; data structures; modular programs with procedures or functions.

It builds on 9.1 Python: Lists and Functions (lists, indexes, traversal with for loops, functions with parameters and return values); 8.1 Python: Iteration and Boolean Operators (for and while loops, comparisons); 7.2 Algorithms and Block Programming (algorithms, decomposition). It leads on to 9.5 Modelling the Real World (coding a model with functions), 9.6 Digital Project for a Real User (choosing algorithms for a client's program) and GCSE Computer Science (J277 2.1 Algorithms: linear, binary, bubble, insertion and merge sort).

Adapting it for your school
If you don't enter Bebras, use lessons 1–2 for more searching and sorting practice (the paper puzzles and extension puzzles) or cut them (they are flex lessons). Lessons 3–5 work in any Python editor, including free online ones; each computer task has an unplugged version on the worksheet. Lesson 5 teaches both insertion and merge sort briefly; if time is short, teach insertion sort fully and show merge sort as a diagram only. Swap the school library for any local catalogue: a shop's price list, a sports club's results or a music playlist.

Two versions in one download. The "With quiz" folder is for schools with a Code & Commerce Quizzes subscription: wherever the lessons use a Progress Check, its multiple-choice questions are ready-made on the quiz site for you to set, with a printed version as the backup. The "Without quiz" folder is the same teaching for standalone use, with no mention of the quiz site and every check on paper. You don't need a quiz subscription to use it.

What's included

  • 6 lesson slide decks (PowerPoint)
  • 6 lesson plans (Word)
  • 6 worksheets, plus 3 support versions with scaffolds (Word)
  • Medium term plan with intent, key words, misconceptions and adaptive teaching notes (Word)
  • Progress Check lesson to assess the unit, with an applied question
  • Python sort timer program
  • Insertion or merge sort and comparing algorithms - Quiz Quiz Trade Cards
  • Department licence: every teacher in your department can use and adapt it
  • Two versions of the files: one for Code & Commerce Quizzes subscribers and one for standalone teaching, no quiz site needed

In this bundle

Worth £24 bought separately at £4 a lesson. The bundle saves you 16%.

More for KS3 Computing

See all

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