Dancing the Bubble Sort

Teachers of Decision Mathematics will be familiar with sorting algorithms which put elements in a list in order. A bubble sort is a sorting algorithm that works by working through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. The pass through the list is repeated until no further swaps are necessary, the elements are then all in order having ‘bubbled’ to their correct positions.

Check Nathan Yau’s Flowing Data blog where he has embedded this video created by Sapientia University in Romania showing a bubble sort illustrated by a Hungarian folk dance.

For further dancing of sorting algorithms see this YouTube channel.

Teaching sorting algorithms will never be quite the same again! If you look at the comments on Nathan’s blog some users have spotted errors but it certainly illustrates the comparison of adjacent pairs very well indeed.

For some more beautiful dance moves see this image!

And a little Dancing with Desmos!