Computer Sorting Algorithms – Visualized.

The way I explain learning to code is that it’s akin to trying to learn another language, one that helps you communicate with computers. It should come as little surprise that much of terminology in linguistics and programming shared (syntax, language, context, etc.) which can help ease people into it, especially if they’ve learnt another language in the past. However I’ve always found the best tools to be visual as its one thing to explain a system you built to someone and it’s another thing to show how it operates and links together. Visualizing algorithms can be quite tricky however although one intrepid person has taken it upon themselves to give sorting algorithms, being one of the fundamental yet readily misunderstood programming paradigms, a visual representation, and it’s glorious.

Whilst this isn’t a particularly scientific way of demonstrating which algorithms are the best (they’ve all been designed to run for roughly the same amount of time and you can see that the number of integers they have to sort varies wildly) it does give you a pretty amazing visual view of how each of the sorting algorithms operate. You can see the patterns of their sorting behavior quite easily and the iterations they go through at each step to sort the array. Probably the most fun I got out of it was reading up on Bogosort afterwards as I couldn’t really tell what it was trying to accomplish by looking at it and the subsequent explanation is a great testament to all the things you shouldn’t do while programming. As a programmer that kind of absurdity is hilarious, unless you see it in production code of course.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.