/sorting-visualizer

Visualization of Sorting Algorithms using Python

Primary LanguagePython

Sorting Algorithm Visualizer using Python and PyQT5

This program visualizes various sorting algorithms graphically and keeps track of various sorting metrics. It also has support for playing sound. The implementation allows for easy addition for additional algorithms. The background code visualizing the sorting is completely invisible to the programmer of the sorting algorithm, which means that you can plug in a completely normal sorting code and it will be visualized without any extra work.

Implemented Algorithms

  • Bubble Sort
  • Insertion Sort
  • Selection Sort
  • Gnome Sort
  • Cocktail Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Comb Sort
  • Shell Sort
  • Counting Sort
  • Radix Sort
  • Python Timsort
  • Bogosort
  • Cubic Sort, O(n^3)

Dependencies (Python 3):

Pillow - Image handling
PyQT5 - GUI library
Install the dependencies with pip3 install -r requirements.txt
To run the program, ./RUN.sh

Key bindings

Space - Pause/Resume Sorting
Left/Right Increase/Decrease Sorting Speed

Rendering styles

The program supports four different rendering methods, each with support for coloring.

Bar graph

Bar Graph Image

Point graph

Point Graph Image

Point spiral

Bar Graph Image

Point circle (disparity)

Bar Graph Image