Animated sorting algorithms

Saturday 25 October 2008This is 16 years old. Be careful.

David Martin has a great page showcasing Animated Sorting Algorithms. Eight different algorithms are shown sorting four different input sets, animated before your very eyes, so that you can see how the different algorithms behave. Not only is this a good looking site, but he has the right pedagogical goals:

These visualizations are intended to:

  • Show how each algorithm operates.
  • Show that there is no best sorting algorithm.
  • Show the advantages and disadvantages of each algorithm.
  • Show that worse-case asymptotic behavior is not the deciding factor in choosing an algorithm.
  • Show that the initial condition (input order and key distribution) affects performance as much as the algorithm choice.

Contrary to some reports, the animations are not coded in Javascript, they are animated gifs, but that’s a fine tradeoff. Professor Martin is spending his server’s bandwidth to save browsers around the world reproducing the same computations over and over again.

Comments

[gravatar]
I don't have the foggiest idea of what any of this means, but that it's pretty cool to watch that site in action.

Paul
[gravatar]
That was WELL worth 20 minutes of my time. Thanks for the link!
[gravatar]
I've always felt old now that sorting algorithms are no longer O(n) but O(n,p), with (n, p) being (number of items, number of processors).

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.