Skip to content

python program for generating bar plot animation for sorting algorithms

Notifications You must be signed in to change notification settings

MikolajLH/anim-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage:

python animsort.py [-h] [-N <int>] [-o <str>] [-a <str>] [-bc <color>] [-pc <color>] [--bg-color <color>] [--tt-c <color>]

options:

  • -h, --help show this help message and exit
  • -N <int> number of elements to sort
  • -o <str> name of file in which the result will be stored
  • -a <str> which sorting algorithm to use: ['quick', 'insertion', 'merge', 'heap', 'selection', 'comb', 'shell', 'bubble']
  • -bc <color> color of bars
  • -pc <color> color of pivot
  • --bg-color <color> background color
  • --tt-c <color> title text color

Examples

python .\animsort.py -N 100 -o merge_sort_demo -bc gray -pc red --bg-color black --tt-c white


python .\animsort.py -N 100 -a quick -o quick_sort_demo -bc blueviolet -pc violet --bg-color teal


python .\animsort.py -N 100 -a insertion -o insertion_sort_demo -pc gold -bc cyan --bg-color darkmagenta --tt-c navy


python .\animsort.py -a shell -N 100 --bg-color deepskyblue -pc lightcyan -bc darkcyan -o examples/shell_sort_demo


python .\animsort.py -a selection -N 50 --bg-color darkred -bc indigo -pc darkviolet --tt-c cornsilk -o examples/selection_sort_demo


python .\animsort.py -a heap -N 100 -bc orange --bg-color lime -pc ghostwhite -o examples/heap_sort_demo


python .\animsort.py -a comb -N 50


python .\animsort.py -a bubble -N 50 --bg-color darkseagreen -bc springgreen -o examples/bubble_sort_demo


About

python program for generating bar plot animation for sorting algorithms

Topics

Resources

Stars

Watchers

Forks

Languages