forked from LucasPilla/Sorting-Algorithms-Visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalgs.py
35 lines (32 loc) · 1.05 KB
/
algs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from algorithms import *
from algorithms.binaryinsertionSort import binaryinsertionSort
from algorithms.bitonicSort import bitonicSort
from algorithms.pancakeSort import pancakeSort
from algorithms.timSort import timSort
from algorithms.stoogeSort import stoogeSort
from algorithms.strandSort import strandSort
algorithmsDict = {
'insertionsort': insertionSort,
'bubblesort': bubbleSort,
'selectionsort': selectionSort,
'mergesort': mergeSort,
'quicksort': quickSort,
'countingsort': countingSort,
'cocktailsort': cocktailSort,
'cyclesort': cycleSort,
'bogosort': bogoSort,
'heapsort': heapSort,
'radixsort': radixSort,
'shellsort': shellSort,
'gnomesort': gnomeSort,
'combsort': combSort,
'bitonicsort': bitonicSort,
'pancakesort': pancakeSort,
'binaryinsertionsort': binaryinsertionSort,
'bucketsort': bucketSort,
'timsort' :timSort,
'stoogesort': stoogeSort,
'strandsort':strandSort
}
def runAlgorithm(algorithm, array):
return algorithmsDict[algorithm](array, 0, len(array)-1)