Skip to content

nikhilkmr300/sort-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sort-visualizer

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

Examples

Snapshots

Snapshots of animations of insertion, merge and heap sorts.

Insertion sort

Note the sorted portion forming on the left.

Merge sort

Note the sorted subarrays before merging.

Heap sort

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.

Profiling

Initialization

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

About

Scripts to visualize common sorting algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages