Skip to content

Sorting Visualizer is a basic simulation software which can simulate a few sorting algorithms. You can set sorting algorithm, type , order , speed and number of sticks etc.

Notifications You must be signed in to change notification settings

arevish/Sorting-Algorithim-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Sorting-Algorithim-Visualizer forthebadge

python License

This is a project to help visualize the way sorting algorithms work. The Sorting Simulation is a basic simulation software which you can simulate a few sorting algorithms. You can set sorting algorithm, speed and number of sticks.

Every stick represents a number; then the software begins to sort them with algorithm which you select before. At the end, you can check comparison number and elapsed time. So you can consolidate your knows.

How to Play the game:

Select the type of sorting algorithm then select the order of in ascending or desending by pressing A or D key respectfully and Finally to solve the board press SPACEBAR, sit back and watch the vizualization algorithm run or press R to reset it.

Algorithims

  • Basic sort and search algorithms

Bubble Sort

  • Bubble sort is a simple sorting algorithm. This sorting algorithm is comparison-based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in
    order. This algorithm is not suitable for large data sets as its average and worst case complexity are of Ο(n2) where n is the number of items.
    Alt text

Insertion Sort

  • Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
    Time Complexity: O(n*n)
    Space Complexity: O(1)
    It is a stable algorithm because it does not change the relative order of elements with equal keys.

Sorting method

Alt text

DEMO -

sorting demo

PLEASE FEEL FREE TO FORK THE PROJECT AND START CONTRIBUTING. :)

Module used

python modules

import pygame

PRE-REQUISITES

Your laptop with python 3.6.x (onwards) installed.

NOTE: Those with Linux and MacOSX would have Python installed by default, no action required.

Windows: Download the version for your laptop via https://www.python.org/downloads/

NOTES In your preferred editor, make sure indentation is set to "4 spaces".

  • Make sure you have pygame installed in python otherwise code may fail, to install pygame in your machine > open python in your terminal then type pip install pygame to install. ⚠️

Run using Python3.8+

  1. Clone or download repositiory: https://github.com/arevish/Sorting-Algorithim-Visualizer.git
  2. In source folder, run python3 'main.py' to start program, optionally, run with --help argument to see other runtime options.

ThankYou!

About

Sorting Visualizer is a basic simulation software which can simulate a few sorting algorithms. You can set sorting algorithm, type , order , speed and number of sticks etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages