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.

tagged:   /   via: Simon Willison» 3 reactions

Comments

[gravatar]
Paul Downs 9:50 AM on 26 Oct 2008

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]
Michael Chermside 7:32 AM on 27 Oct 2008

That was WELL worth 20 minutes of my time. Thanks for the link!

[gravatar]
Charles Merriam 11:00 PM on 27 Oct 2008

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:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.