A team from Sapientia University, a Hungarian university located in Transylvania, Romania, has released some totally amazing videos on YouTube, in which a row of dancers demonstrate different sorting algorithms.
I’m in a bit of a rush right now, but I’ll put up descriptions of, and code for, the algorithms as soon as I find time. (Yes, I know Wikipedia already has excellent information on all these sorting algorithms—and others! But points for effort, no?) For what it’s worth, I sorted this list of algorithms into alphabetical order using manual bubblesort.
This actually reminds me of Neal Stephenson’s Anathem, where monks solve problems in differential geometry by using dances to represent raising and lowering indices, tensor contraction, and the like. (Yes, I am a nerd.)
Updated:
Here’s a little bit on quicksort and insertion sort, the first two that come to mind. I’ve written up the code in Haskell because (a) Haskell is great to code in if you’re lazy, and (b) Haskell code looks like pseudocode anyway. Granted, that means the code might not always be optimized for killer speed, but it is guaranteed to be functional (pun intended!) and will convey the basic insight of the algorithm. Most of the pseudocode for these algorithms available online is usually written with some sort of heavily imperative language like C in mind. That’s fine, because imperative languages give us much better performance and are far more common in the real world. However, such languages also usually force us to get our hands really dirty with all sorts of messy details. Functional languages like Haskell, on the other hand, make us really think about the purpose underlying the algorithm. (I have seen some people call Haskell descriptive, as opposed to the prescriptive way that imperative languages work.) In other words, functional languages force us to get away from implementation-level details and to think about the actual algorithm itself. This is ultimately why I decided to try to write this code in Haskell.
I’m in a bit of a rush right now, but I’ll put up descriptions of, and code for, the algorithms as soon as I find time. (Yes, I know Wikipedia already has excellent information on all these sorting algorithms—and others! But points for effort, no?) For what it’s worth, I sorted this list of algorithms into alphabetical order using manual bubblesort.
This actually reminds me of Neal Stephenson’s Anathem, where monks solve problems in differential geometry by using dances to represent raising and lowering indices, tensor contraction, and the like. (Yes, I am a nerd.)
Updated:
Here’s a little bit on quicksort and insertion sort, the first two that come to mind. I’ve written up the code in Haskell because (a) Haskell is great to code in if you’re lazy, and (b) Haskell code looks like pseudocode anyway. Granted, that means the code might not always be optimized for killer speed, but it is guaranteed to be functional (pun intended!) and will convey the basic insight of the algorithm. Most of the pseudocode for these algorithms available online is usually written with some sort of heavily imperative language like C in mind. That’s fine, because imperative languages give us much better performance and are far more common in the real world. However, such languages also usually force us to get our hands really dirty with all sorts of messy details. Functional languages like Haskell, on the other hand, make us really think about the purpose underlying the algorithm. (I have seen some people call Haskell descriptive, as opposed to the prescriptive way that imperative languages work.) In other words, functional languages force us to get away from implementation-level details and to think about the actual algorithm itself. This is ultimately why I decided to try to write this code in Haskell.
