Sorting Algorithms

Lightest and Heaviest

Almost any list that comes out of a computer is sorted into some sort of order, and there are many more sorted lists inside computers that the user doesn’t see. Many clever algorithms have been devised for putting values into order efficiently.

In this activity students compare different algorithms to sort weights in order.

Photos

• Supplies used for the sorting algorithm activities

Related Resources

• An older version of this activity can be downloaded in PDF format here. The content is similar to the current version, but there’s some extra technical information.
• Sorting algorithms visualisations:
• To visually demonstrate the concept of  some popular algorithms for sorting data, see the following website developed by David Martin at http://www.sorting-algorithms.com/.
• Aldo Cortesi’s Canvas visualisation of algorithms is another way to visualise sorting algorithms by Jacob Seidelin at Canvas Visualizations of Sorting Algorithms Teachers could print these out for different search parameters for different sort algorithms and hang these canvases as posters in the classroom. These could then be used in quizzing the students on specific algorithms or comparing sorts side by side. See also Cortesi’s Blog at Visualising Sorting Algorithms
• Another visual or timed view of sorting algorithms developed by David Eck can be seen at The xSortLab Applet.
• Thomas Baudel has visualisations of sort algorithms at Sort Algorithms Visualizer
• If you want to find out more:
• Virginia Tech, Dept of Computer Science has a complete module on Algorithms. See the lessons that relate to Sorting Algorithms below:
• A famous story about the boy wonder of mathematics has taken on a life of its own. American Scientist has an article called Gauss’s Day of Reckoning by Bryan Hayes. The number of comparisons made for the simple sorting methods can be calculated using the sum 1+2+3+…+n-1, which is equal to n(n-1)/2. This series is often associated with stories of the mathematician. Gauss, who apparently used this equality to frustrate a teacher who had assigned the class to add up all the numbers from 1 to 100. There’s a wonderful article about whether or not this story is apocryphal.
• BBC h2g2 has some articles on algorithms below: