I did not come across with a sorting algorithm animation that allows me to enter my own data, so I decided to write one in Maple.

In this worksheet, you can create an animation on sorting the integers that you have entered. If you let the worksheet to generate the data for you, you can specify the sortedness of the data. This feature allows you to visualize how some algorithms perform better or worse on data of a certain characteristic: The time complexity may not be the only factor for determining the best algorithm to use. For example, heap sort is not good on data that is almost sorted.

Here is an animation of selection sort:

Have fun!

P.S. Thanks Erik P and Dave L for their suggestions.

Edit (April 25, 2012): Fixed a bug in Cocktail Sort.  Slower animation speed is now available.


Please Wait...