Jason Thomas

I like to make stuff

August 31, 2016 @ 19:04

Sorting algorithms on video - because I'm a visual learner

I enjoy learning about algorithms, but I don't enjoy the language often used to describe what should be simple concepts.

There seems to be a tendency to explain machine learning and sorting algorithms in a textbook style with mathy formulas. I know people have good reasons for doing that.

However, I learn best by watching and doing, not by reading formulas. For me, once I've got the basics sorted I can learn optimisation later through more complicated explanations.

So I've decided to make videos of things for the benefit of people who learn best by watching, much as I do.

Sorting algorithms

One of my favourite things to think about is the different types of sorting algorithms available and all their different use cases. You don't even need a computer to run a sorting algorithm. It can be done on paper, with blocks, sticks or with Rummy tiles.

These are videos showing how four common sorting algorithms can be implemented. There are many more sorting algorithms that can be used. I make no attempt to go into detail about where and when each algorithm is useful, since that information is all over the web already.

I'm also not suggesting these are efficient ways to implement these algorithms; these are my best attempt to explain the basic concepts in plain language. I wouldn't consider these Quicksort or Merge Sort examples to be efficient examples.

Selection Sort

Insertion Sort

Merge Sort

Quicksort

If you want to know more about sorting algorithms, check out this excellent website. The author of the excellent d3 library, Mike Bostock, has written some great stuff on sorting algorithms and other algorithms generally.

log in