This is part 1 of an ongoing project in which I attempt to recreate commonly used algorithms in analog format.
These very short videos attempt to represent the way the sort function works when array.sort() is called in the browser. While they all return the same sorted array (except for Sally sort), each gets there in a slightly different way. The video above shows array.sort() in the context of a short script for sorting a simple array.
Clicking on "Method" below each video will show the steps taken by the browser, which I captured live by placing some extra code into the script to record the position of each item being compared, and the flag that was returned by that comparison. View the full script here.
As a bonus, I include a method for random sort (Sally sort) using an unpredictable external input source.
Fond thanks as always to Tim Menzies, for consultations.
No thanks to Sally Ride, who is a Very Bad Kitty.