SortingAlgorithmVisualization

A place for me to learn about sorting algorithms.

Getting started

  1. Install python on your machine.
  2. Install pygame by running this command: pip install pygame.
  3. Navigate to the folder at which main.py is located.
  4. In your terminal run python main.py

How to navigate the GUI

On the bottom of the screen there are buttons with different sorting algorithms. Press on one and it will randomize the array and start sorting it.
To increase the number of elements in the array press the .
To decrease the number of elements in the array press the .
To increase the Frame Rate press the .
to decrease the FrameRate press the .

Implemented sorting algorithms

Counting Sort

Counting Sort is a good algorithm for lists with small positive integer
Speed: O(n+k)
n is number of elements in the array.
k is range of possible numbers in the array.

Bubble Sort

Bubble Sort a simple inefficient sorting algorithms. Works with any float or integer
Speed: Speed: O(n²)
n is number of elements in the array.

Quick Sort

Quick Sort is a divide and conquer sorting algorithm.
Speed: O(log n)
n is number of elements in the array.

Bogo Sort

Bogo Sort is made as a joke. It works by shuffling the list until it is sorted.
Speed: O((n-1)* n!)
n is number of elements in the array.

GitHub

View Github