Quick sort – OCR A Level Computer Science lesson (H446)
Students learn to partition a list around a pivot, complete a quick sort, and explain its best and worst cases.
Lesson 11 of 15 in unit 12.4 Searching, Sorting and Recursion, taught in Year 12, Autumn 2. It answers one big question: How does quick sort put each pivot in its final place?
By the end, students can partition a list around a pivot, complete a quick sort, and explain its best and worst cases.
- The Build (the main task)
- Trace how quick sort sorts Tidewave Audio's list of track lengths [210, 185, 240, 160, 300, 195], using the first item of each sublist as the pivot and writing the list after each partition (6 marks).
- Support version
- A worked first partition with the pivot circled, then empty rows for each later partition with the pivot named.
- Challenge
- Explain why quick sort with the first item as pivot is slow on Tidewave Audio's chart if the chart is already in order, and suggest a better choice of pivot (4 marks).
- Real-world link
- Tidewave Audio orders track lengths to build playlists that fit an exact time.
- Key words
- Quick sort, Pivot and Partition, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “In partitioning, each item is compared with its neighbour, as in bubble sort”; “The pivot moves again in later partitions”.
- OCR H446 specification
- 2.3.1 (f); 2.2.2 (d) (use of divide and conquer as a computational method).
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.
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 allStudents learn to apply problem-solving strategies to unfamiliar Bebras tasks and explain the reasoning behind each answer.
Students learn to sit the UK Bebras Computational Thinking Challenge, managing their time and checking answers against the task's rules.
Students learn to write a linear search as a function in Python and OCR pseudocode, and state its best and worst cases.
Free sample lessonWritten for the specifications named. Not endorsed by or affiliated with any exam board.