Scripts to visualize and profile common sorting algorithms.
I've wanted to make this sort of animation since the first time I saw it in CS50 about 4 years ago, because they look so cool.
Includes the following sorting algorithms:
- Bubble sort
- Selection sort
- Insertion sort
- Merge sort
- Quick sort
- Heap sort
- Radix sort
Snapshots of animations of insertion, merge and heap sorts.
Note the sorted portion forming on the left. Note the sorted subarrays before merging. Note the sorted portion forming on the right, as the root of the max-heap is extracted and pushed to the back of the array.Includes the following possible array initializations in the initializer directory:
- random: Randomly initializes array in range [low, high)
- reverse: Initializes array in reverse sorted order
- many_same: Initializes array with many similar elements
- error: Initializes array with elements in a uniform distribution around an anchor