Sorting algorithms as dances
Sunday, 10 April 2011

What happens when you attempt to demonstrate sorting algorithms using folk dancing? The result is slightly surreal and you'll probably always hum a tune in future when implementing a Bubble, Shell, Insert or Select sort.

 

You may well have seen many simulations of sorting algorithms that aim to show in novel ways how the algorithm works or perhaps doesn't work quite as well as it should. However I guarantee that you have never seen anything quite in the same league as the videos made by Sapientia University - they are simply crazy but in the nicest possible way.

Take one Central European folk dancing team, a small folk band and an added overlay showing array locations and get them to dance the algorithms in time to "appropriate" folk music. The result is slightly surreal and for a time at least slightly hypnotic.

 

sortdance

 

What you have to do is just check that they are in fact implementing the algorithm correctly. The dancers have numbers stuck on their front and they do seem to look down and examine the value on another dancer before performing the dance routine dictated by the algorithm

To see what I mean try the simplest of all sorts, the Bubble sort:

 

              

All that happens is that adjacent partners swap if they are in the wrong slot until the algorithm is complete. Notice they have to do a final pass before they can decide that it really is "all sorted".

If you think that was too simple, try the Shell sort:

 

 

Shell sort is just a bubble sort but with the swaps occurring over greater distances reducing each time.

And for something simpler the Insert sort:

 

 

For the finale Select sort:

 

As I say delightful, amusing and slightly eccentric. We can look forward to the Fast Fourier waltz and the depth first tree walk....  Some how though I really don't think that they will manage the Quicksort as any type of dance - expect perhaps something really modern....

Update 24th April 2011

The team have now added a full merge sort to the repertoire: Merge sort as folk dance

Update 2nd May 2011

They have proved me wrong .... all it need for Quicksort as a Hungarian dance is a pair of hats:
At last - Quicksort the dance

Further Reading:

Silverlight Sorting Lab

SilverSort

Magic of Merging

QuickSort exposed

Sequential storage

Banner


Neural Networks Describe What They See
19/11/2014

There has been an amazing growth in what neural networks can do and the next step is to put vision together with language to produce a network that can describe what it sees.



What Does The NSA Think Of Cryptographers?
22/11/2014

A recently declassified NSA house magazine, CryptoLog, reveals some interesting attitudes between the redactions. What is the NSA take on cryptography?


More News

Last Updated ( Tuesday, 03 May 2011 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.