Skip to content

πŸ“Š A collection of sorting algorithms written in Python. An educational tool used for demonstrations of said algorithms.

Notifications You must be signed in to change notification settings

ArcherHume/sortingAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

sortingAlgorithms

A collection of sorting algorithms written in Python. An educational tool used for demonstrations of said algorithms.

Current Algorithms

Quick Start

  • Clone Repository:
    git clone https://github.com/ArcherHume/sortingAlgorithms.git
    cd sortingAlgorithms
    
  • Install Dependencies:
    pip install -r requirements.txt
    
  • Run Script: Usage

Usage

USAGE:
    python main.py -t [algorithm]

    Flags:
        -t [algorithm] (Required): The algorithm you would like to run.
            Choose from: selection, selection_recursive, bubble, quick_sort, insertion, shell, comb.
        -l [length] (Optional): The length of the array to be sorted. Defaults to 5000.
        -r [repeats] (Optional): The number of times to repeat the algorithm. Defaults to 3.
        -d [delay] (Optional): The delay between each step of the algorithm, used to watch each individual step. Defaults to 0.
        -width [width] (Optional): The width of the screen. Defaults to 800.
        -height [height] (Optional): The height of the screen. Defaults to 600.
        -h (Optional): Prints this message.
        -debug (Optional): Enables debug mode.

    Example: python main.py -t selection -l 10000 -r 6

How to add a new algorithm

  • Open the modules/sorting_algorithms.py file.
  • Create a function with a lowercase, underscore-separated name. Add the positional arguments array then delay.
    • Example: def selection_sort(sorting_array, delay)
  • Any modifications/sorting done on the array will be reflected on screen.

About

πŸ“Š A collection of sorting algorithms written in Python. An educational tool used for demonstrations of said algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages