Sorting Algorithm Animations
sorting-algorithms.com
sorting-algorithms.com
http://news.ycombinator.com/item?id=1905940
http://news.ycombinator.com/item?id=1733814
http://news.ycombinator.com/item?id=730346
http://news.ycombinator.com/item?id=555549 <- This has some comments
There are more:
http://searchyc.com/submissions/sort+algorithm+animation?sor...
An interesting static visualization from the other threads is here : http://www.hatfulofhollow.com/posts/code/visualisingsorting/...
I think seeing the timing and sorting in action is so helpful to understand what is going on.
I'm currently looking at automating some of the process, but I do find that searching for stuff I think I remember occasionally turns up a gem I missed, and so I'm reluctant to automate it fully unless they still get found.
That's why I'm starting to feed items into a Bayesian classifier to find good stuff - by my standards and according to my interests. I continue to experiment.
Bubble sort takes the most time. :)
Edit: Never mind they explained:
From the comparions presented here, one might conclude that selection sort should never be used. It does not adapt to the data in any way (notice that the four animations above run in lock step), so its runtime is always quadratic.
However, selection sort has the property of minimizing the number of swaps. In applications where the cost of swapping items is high, selection sort very well may be the algorithm of choice.
I can imagine doing this with an A* search: snapshot the graph, including which nodes are open or already visited, along with the heap ranking of the next nodes to visit. You might also want to show all the newly neighboring nodes and annotate them with their updated cost estimate.
He explains his anti-animation rationale here: http://corte.si/posts/code/visualisingsorting/index.html