Sorting algorithms demonstrated with Hungarian folk dance

April 14, 2011  |  Coding

Bubble sort dance

We've seen sorting algorithms visualized and auralized, but now it's time to see them through the spirit of Hungarian folk dance. In a series of four videos (so far), folks at Sapientia University in Romania demonstrate how different sorting algorithms work with numbered people dancing around and arranging themselves from least to greatest.

See them in action in the video below. This one is for Bubble-sort. They move with such zest.

[Video Link via @shancarter & Boing Boing]

17 Comments

  • I would have watched this unendingly on Sesame Street. It’s an awesome candidate for the show!

  • maurice vergeer April 14, 2011 at 2:20 am

    so this is why SPSS takes long to sort data files :-)

  • It is worth noting that there’s a bug in the video. When they do the first pass two dancers become part of the sorted array even though only 9 should have done so.

    • Herbert P. April 15, 2011 at 4:00 am

      No bug in pass 1.The error is committed by dancer 6 when he fails to turn around in pass 2 after seeing that his partner (to his left) has turned around. It is obvious from watching subsequent passes that the criterion for what is already sorted makes use of the contiguity of the sorting key. Although it is inconsistent that this data property is not also used to eliminate at an early stage sorted elements at the low end, this is probably done to keep the sort reasonably bubbly.

  • nick tulip April 14, 2011 at 7:33 am

    I don’t know how you reached the conclusion that it’s a Hungarian folk dance.

    • nick tulip April 14, 2011 at 7:34 am

      obviously it’s in the video title and it’s created by hungarians – but it’s also very Romanian.

      • .NetRolller 3D April 14, 2011 at 1:53 pm

        Definitely Hungarian – specifically, a Gyimes Csángó dance. I have a few Gyimes Csángó friends myself, and they would definitely protest being called “Romanians”.

  • It looks to me like they’re using _Hungarian Notation_ for this dance! :D

  • This begs the question: can dance-based computing scale? Boy, this post makes me hungry for lángos… =D

  • lovely! :D
    i must say that dance is more awesome then the bibble sort algo itself :D

    i noticed the dance not the algorithm :P

  • I felt panic when they started dancing again at the end. “NOOO! The array is sorted! Don’t move!”

  • It would have been interesting to see them do a bucket sort. Much faster, but shorter duration. Perhaps a Radix Sort might be interesting as well, but would require more people. This opens a new genera of dance for searching algorithms, skip searches, Linked List Searches, Corral Rings, and perhaps bi-directional linked lists and linked list insertions and deletions? What great fun.

  • Nice. Reminds me of the video survey of sort algorithms done by the Knight School’s Algorithmic Thinking class: http://www.youtube.com/watch?v=INHF_5RIxTE

  • who can tell me what’s the name of this song???

  • very cute. I will use this fall when I teach data structures

Unless otherwise noted, graphics and words by me are licensed under Creative Commons BY-NC. Contact original authors for everything else.