A simple python project which visualizes various sorting algorithms.
Simply open up your terminal and type
pip3 install sorting-visualizer
- Bubble Sort (bubblesort)
- Selection Sort (selectionsort)
- Insertion Sort (insertionsort)
- Merge Sort (mergesort)
- Quick Sort
- Heap Sort
-
Show the plot
from sorting_visualizer import visualizer visualizer.visualize('bubblesort')
-
Show and save the plot
from sorting_visualizer import visualizer visualizer.visualize('bubblesort', save=True)
-
Only save the plot and not show it
from sorting_visualizer import visualizer visualizer.visualize('bubblesort', save=True, show=False)
-
Saving in a particular location
from sorting_visualizer import visualizer visualizer.visualize('bubblesort', save=True, path='path/to/directory')
The default saving location is your current working directory.