Various simulations of algorithms can be seen everywhere, especially in nature, but a recent project from the Sapientia University, Romania is definitely one of the most imaginative and novel initiatives of illustrating algorithms. The folks at Sapientia University demonstrate how different sorting algorithms work with numbered people dancing traditional Central European folk songs and arranging themselves from least to greatest.
The result is hypnotic to say the least. Just look at the Bubble Sort method applied to a traditional Hungarian dance below.
Adjacent partners swap if they are in the wrong slot until the algorithm is complete. They have to do a final pass before they can decide that it really is “all sorted”. Here’s the Shell Sort as well.
And the simpler Insert Sort.
Finally, the Select Sort.
Enjoyed this article? Join 40,000+ subscribers to the ZME Science newsletter. Subscribe now!