forked from LucasPilla/Sorting-Algorithms-Visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalgs.py
More file actions
36 lines (32 loc) · 1.54 KB
/
algs.py
File metadata and controls
36 lines (32 loc) · 1.54 KB
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
36
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
from algorithms.oddevenSort import oddevenSort
algorithmsDict = {'insertion' : insertionSort,
'bubble' : bubbleSort,
'selection' : selectionSort,
'merge' : mergeSort,
'quick' : quickSort,
'counting' : countingSort,
'cocktail' : cocktailSort,
'cycle' : cycleSort,
'bogo' : bogoSort,
'heap' : heapSort,
'radix' : radixSort,
'shell' : shellSort,
'gnome' : gnomeSort,
'comb' : combSort,
'bitonic' : bitonicSort,
'pancake' : pancakeSort,
'binary insertion': binaryinsertionSort,
'bucket' : bucketSort,
'tim' : timSort,
'stooge' : stoogeSort,
'strand' : strandSort,
'odd-even' : oddevenSort }
def runAlgorithm(algorithm, array):
return algorithmsDict[algorithm](array, 0, len(array)-1)