Examples
Quick sort in Python, swap by swap
Seven numbers sorted around a pivot: each comparison and swap beside the Python line that makes it, then the run’s 10 comparisons on the growth chart.
This video was made with the Algorithm visuals skill.
- 1:05
- Algorithm visuals
- Narrated by Charon
- English
Made from a prompt
Quick sort on 8, 3, 6, 1, 9, 2, 5, step by step in Python
Video transcript
How can you sort these numbers without repeatedly finding the smallest?
These 7 numbers need sorting. Through i, values stay at most the pivot. Orange marks executing code; green means done.
Line 8 picks pivot 5. Line 11 leaves 8 right because it exceeds 5.
3 belongs left. Which number will it swap with?
3 swaps with 8; 1 and 2 also move left because neither exceeds 5.
5 lands between the sides, permanently placed.
Recursion partitions the left around 2; single numbers need no sorting.
8 separates 6 and 9; the pivot rule now holds everywhere. Worst-case work is quadratic.
The chart marks 10 comparisons for 7 numbers; average work grows as n log n.
Partition, then sort each side: that's how you order the numbers.
More examples
-
Where the money goes when you buy a $5 coffee A $5 latte split into what it pays for, one hand-drawn picture at a time: ingredients, staff, rent and running costs, the 50¢ left over, and why a quiet day makes every cup carry more rent. 2:14 · English -
Why your stomach gets gassy Where gas comes from, drawn and painted in as it is said: swallowed air, gut bacteria and foods like beans and milk, what normal looks like, what helps, and when to see a doctor. 2:17 · English -
A train’s average speed, then a triangle’s area Two problems on a teacher’s board: the options in a row, every line of working written as it is said, each answer checked before it is drawn. 2:07 · English
Your topic, drawn in about a minute.
Your first 2 videos are free, up to 1 minute each, watermarked. No card required. Full product, every voice and style included.