# Sorting algorithms demonstrated with Hungarian folk dance

April 14, 2011

### Topic

Coding  /  , ,

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]

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

• maurice vergeer

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

• Who told you that SPSS uses a bubble sort?

• 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.

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

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

• nick tulip

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

• .NetRolller 3D

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”.

• Jason

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

• I love it.

• 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!”

• Chris

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

• able

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

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