The sorting algorithm that shouldn’t.



Click this link and use my code STANDUPMATHS to get 25% off your first payment for boot.dev

Stanley P. Y. Fung’s original paper can be found here:

Along with an addendum to paper answering all of your burning questions here:

The viral video of sorting algorithms visualiser and sonifier is here:

And more info on the sonifier:

If you want some info on genuinely useful sorting algorithms the check out Boot.Dev’s video:

Thank you to Andy Chisholm for creating the brilliant sound effects for the SWAP graphic. Find him over at www.andychisholm.com

For more unnecessary detail, tickets for upcoming London (including on September 7th) shows are available here:

Also I’m touring the UK again for the final time with Getting Triggy With It this Autumn. It’s a short tour, so get your tickets here:

Huge thanks to my Patreon supporters.There is no sorting algorithm I have yet found which could put them in order.

CORRECTIONS
– Thanks to a few people for pointing out my dry-wipe pseudo-code for Bubble Sort is a bit out. where it says “if i [greater than] i+1” it should read “if L[I] [greater than] L[i+1]”. Also this correction should use the ‘greater than’ symbol but YouTube won’t let me put them in.

Filming by Alex Genn-Bash
Editing by Gus Melton
Written and performed by Matt Parker
Directed by Rhys Jones
Produced by Nicole Jacobus
Music by Howard Carter
Design by Simon Wright and Adam Robinson

MATT PARKER: Stand-up Mathematician
Website:
Click this link and use my code STANDUPMATHS to get 25% off your first payment for boot.dev

Stanley P. Y. Fung’s original paper can be found here:

Along with an addendum to paper answering all of your burning questions here:

The viral video of sorting algorithms visualiser and sonifier is here:

And more info on the sonifier:

If you want some info on genuinely useful sorting algorithms the check out Boot.Dev’s video:

Thank you to Andy Chisholm for creating the brilliant sound effects for the SWAP graphic. Find him over at www.andychisholm.com

For more unnecessary detail, tickets for upcoming London shows are available here:

Huge thanks to my Patreon supporters.There is no sorting algorithm I have yet found which could put them in order.

CORRECTIONS
– None yet, let me know if you spot anything!

Filming by Alex Genn-Bash
Editing by Gus Melton
Written and performed by Matt Parker
Directed by Rhys Jones
Produced by Nicole Jacobus
Music by Howard Carter
Design by Simon Wright and Adam Robinson

MATT PARKER: Stand-up Mathematician
Website:

source

20 Comments

  1. 8:30 so close! i mean of course your code works, but the typical idiom for such a programming task is "while not finished: finished = true; do inner loop maybe set finished back to false;"

  2. If you are interested in sorting algorithms, there is also a number of videos that visualizes them by the means of folk dances. Just search for "sort algorithm folk dance" and have fun. 😊

  3. Critical mistakes in this video I noticed while watching (please never get a real job):

    1. 8:00 – forgot the outer loop, only iterates over the list once. Somehow you invented O(n) sorting, most efficient sorting algorithm ever!

    2. 9:2814:13 comparing indexes instead of comparing the value at each index. Yes, you performed it correctly but what you put on screen was totally wrong, maybe you edited this video late at night?

  4. Adding favourites to the list of algorithms before it gets sorted:

    Rationalisation sort: Assume the list is already in order, and find a set of features, no matter how abstract, for the elements of the list that demonstrate that the list is indeed already sorted.

    Intelligent Design Sort: The existing order was created by a higher power and any rearrangement is hubris.

Leave a Reply

Your email address will not be published. Required fields are marked *

You might like

© 2026 Cantinho do Vídeo - WordPress Video Theme by WPEnjoy