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

This video shows how the list 9, 8, 4, 6, 3 is sorted using the algorithm.

Checking my email today I noticed this link from the Maths Links group on Diigo shared by Garrett Eastman.

The link is to 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!

# Decision Maths Tools

There are a variety of free tools available, for example this Graph Creator from the Illuminations site includes the facility to explore Hamiltonian cycles.

For the Simplex method this tool is very easy to use. Selecting Example then Solve shows how to use the applet.

A Linear Programming Grapher is available from the same site.
Alternatively use the excellent Desmos graphing calculator which shows inequalities very clearly.

This applet allows you to enter a network and then find the shortest path using Dijkstra’s Algorithm.
Firstly click to draw the nodes, once all the nodes are in place use the drop down menu on the left to draw the arcs.
The documentation at the top desctribes each function.

To see some Kruskal examples try ‘Step Solve’ on this applet and similarly for Prim.

On a lighter note – some Decision Maths Dancing!