Skip to content

chrismilson/sorting-visualiser

Repository files navigation

Sorting Visualiser

A simple visualisation tool for some well known sorting algorithms.

Usage

When you load the page you will be presented with sorted data.

initial state

Pressing play here will perform the currently selected sort (heapsort by default) on the already sorted data.

heapsort on sorted data

The data can be modified/unsorted by using the unsorting algorithms (in pink) made visible by opening the extended menu (the button marked ).

the extra menu

The current sorting algorithm can also be set in this menu by pressing the blue buttons.

Try to modify the data in such a way that you get an idea for the algorithm. For example, running timsort on reverse sorted data is very fast, but quicksort is very slow!

timsort on reverse sorted data quicksort on reverse sorted data

Keyboard Shortcuts

There are some keyboard shortcuts for the experienced user:

Key Action
Space Play / Pause
*when playing* Increase Animation Speed
*when playing* Decrease Animation Speed
*when paused* Next Move
*when paused* Previous Move
Increase Data Size
Decrease Data Size
r Reset to initial unsorted state
` Reverse Animation Direction
Esc Open / Close Extended Menu
s Show / Hide Stats for Nerds