2010-05-06

Visualizations of Sorting Algorithms, now including comparison time

Originally from , April 15, 2009, 3:49 AM by Jacob Seidelin Canvas Visualizations of Sorting, which in turn came from Visualising Sorting Algorithms, by Cortesi. I modified the visualization to display the data comparisons in addition to the data swapping, since both are important aspects of performance. Also, in order to more accurately elucidate all the computations, for insertion sort, I made the insertion operation into a sequence of swaps, and for selection sort, I made the search for a maximum value into a sequence of comparisons.

I added the Merge sort and Comb sort that Cortesi has more recently added. I expect I will add all the rest, and maybe a few more of my own design. I'm thinking of a multi-level heap sort.

Instructions: If "Constrain canvas width" is checked, the canvas width is stretched to the value of the "Width" field and "Step width" is ignored. If not, each step will use "Step width" pixels.

Algorithm: NumElements: Reuse data array:
Height: Width: Constrain canvas width: Step width:

No comments: