Back

It’s not in the mark scheme

27 March 2026

When “not in the mark scheme” doesn’t mean wrong – what Quicksort teaches us about accepting valid alternatives 

A question that surfaces every revision season is this:
“If a student’s answer isn’t in the mark scheme, can they still get credit?” 

Happily, the answer is yes. 

Mark schemes guide examiners toward expected answers, but they’re not exhaustive. A response that demonstrates the required understanding, even if expressed differently, should still earn marks, and examiners are trained to recognise valid alternatives. 

Few topics illustrate this better than the story of the Quicksort, and the many ways students might correctly perform it. 

Remembering Tony Hoare, creator of Quicksort 

It felt fitting to reflect on this, following the sad news that Professor Sir Charles Hoare (“Tony Hoare”) passed away peacefully on 5 March 2026 at the age of 92. Hoare is widely regarded as one of the greatest thinkers in the history of computing. His most famous contribution was the Quicksort, the algorithm that has sparked more A level debates and classroom disputes than possibly almost any other. 

The origin story is wonderfully humble. In 1959, while studying machine translation at Moscow State University, Hoare needed a fast way to sort Russian words. Bubble sort wasn’t going to cut it. So, armed with paper and pencil, he devised Quicksort. Ironically, he couldn’t actually implement it, the language he was using, Mercury Autocode, was too limited. 

When he returned to England and joined Elliott Brothers in 1960, one of his first tasks was to write a Shellsort. After completing it, he casually mentioned to his boss that he knew a faster method. His boss responded with a sixpence bet – one Hoare won when Quicksort outperformed all expectations. 

So why don’t students’ Quicksorts match the mark scheme? 

Quicksort isn’t a single algorithm. It’s a family of algorithms. Researchers and engineers have created hundreds of variants, each valid, each useful, each “Quicksort.” 

This naturally leads to classroom friction: 

  • “That’s not how we learned it in Maths!” 
  • “But my teacher said the pivot never moves!” 
  • “This example is nothing like the mark scheme…” 

The truth is: students aren’t wrong. Teachers aren’t wrong, and neither is the mark scheme! They’re often just using different, but valid variants. That’s exactly why rigidly expecting a single form of Quicksort can result in unfairly penalising correct answers. 

What teachers should really look for with algorithms 

Don’t advise students to memorise code blocks. Instead of matching specific code, teachers and students should look for the essential components that all Quicksort variants share: 

  1. A pivot selection strategy

Common approaches include: 

  • First element 
  • Last element 
  • Middle element 
  • Random pivot 
  • Medianof3 
  • Medianof5 
  • Tukey’s ninther 
  • Adaptive schemes (e.g., introselect) 
  1. A partitioning scheme

Popular methods include: 

  • Hoare partition – efficient, uses two indices 
  • Lomuto partition – conceptually simple, uses one index 
  • Bentley–McIlroy 3way – excellent for data with many duplicates 
  • Dualpivot – used in Java’s standard sort 
  1. A recursive divide-and-conquer structure

Often supported by implementation choices such as: 

  • Tailrecursion elimination 
  • Cutoffs to insertion sort 
  • Memory layout optimisations 
  • Parallel variants 
  • Introsort hybrids 
  • Cacheoblivious versions 
  1. A base case

The recursion stops when a sub list contains 0 or 1 elements. 

  1. Combination of the results

When all partitions are sorted, the fully sorted list is formed. 

 

Where the confusion really comes from 

Most disagreement stems from the popularity of two different partitioning approaches: Hoare or Lomuto, and the fact that many teachers were taught one or the other. 

To complicate things further a visualisation called the “Hungarian dancers” (thanks to a viral YouTube video) uses the first element as the pivot but allows it to move during partitioning meaning it’s not a pure Hoare partition, it’s a variant that is inefficient but can make it easier to visualise what the pivot is doing. 

So, when a student’s working doesn’t match what’s in the mark scheme or what you’ve seen before, remember: it may still be a perfectly valid algorithm. 

Want clear, classroom-friendly examples? 

To support teachers CPD, we’ve included full walkthroughs of the Hoare, Lomuto, and the Hungarian variant with code in Python, C#, and Visual Basic in our book:
👉 https://www.amazon.co.uk/dp/B09NRBS8ND 

Oh, and that documented meeting between Tony Hoare and Nico Lomuto we included? That’s just fiction! …but Tony did win the sixpence from his boss! 

Check out the ‘At the chalk face’ podcast for more!

Related posts

Taking the next step

Teaching careers rarely follow a straight ladder, and the most valuable opportunities are often the ones that sit to the side of it. The key is understanding what each role really gives you — and whether that’s career progression, professional growth, or both.

22 May 2026

Cambridge OCR: Supporting Teachers, Inspiring Students & at this year’s Festival of Computing

Cambridge OCR, a leader in UK Computing education, is sponsoring this year’s Festival of Computing —bringing expert insight, CPD, and a passion for supporting teachers. Discover how they’re shaping the future of qualifications and why you won’t want to miss connecting with them at the event.

15 May 2026

Would we do it again?

As May edges closer to its final days, many teachers find themselves staring at the same date every year: 31 […]

8 May 2026

AQA at the Festival of Computing 2026

AQA, the UK’s largest exam board and education charity, joins the Craig’n’Dave Festival of Computing 2026 as Headline Sponsor, bringing expert insight, CPD sessions and curriculum expertise to support secondary Computer Science teachers.

7 May 2026

How a GCSE in computer science can shape your students’ future careers

A GCSE in Computer Science isn’t just a qualification—it’s a launchpad to exciting careers in tech, from gaming and robotics to cyber security and AI.
By connecting classroom learning to real-world pathways, teachers can inspire students to see the true value and future potential of their skills.

1 May 2026

How a GCSE in Computer Science can shape your future career

A GCSE in Computer Science opens the door to careers in gaming, robotics, cyber security, and beyond.
Discover how this subject can lead to exciting degrees and future opportunities in the tech world.

29 April 2026

Do we need government AI copyright laws?

AI is transforming creativity — but are we protecting the people behind the art? We explore the UK’s heated debate over AI copyright laws and what they mean for creators and innovation.

8 April 2026

How Do Map Apps Work?

Discover how your map app uses graph theory and clever algorithms to find the fastest route, even before you spot the traffic jam. It’s the smart tech behind every turn and reroute you trust.

What is Chip Binning?

Chip binning is how manufacturers sort silicon chips based on their performance, turning some into high-speed processors and others into more modest models. It’s like baking cookies—some come out perfect, others just good enough.