forked from Azanul/Sorting-Visualized
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
64 lines (30 loc) · 1.29 KB
/
main.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from heap_sort import sort as HS
from insertion_sort import sort as IS
from merge_sort import sort as MS
from quick_sort import sort as QS
from radix_sort import sort as RS
from selection_sort import sort as SS
from bubble_sort import sort as BS
from cocktail_sort import sort as CS
from OFA import *
tk.title("Sorting Visualized")
generate()
btn1 = Button(tk, text = 'Shuffle', bd = '5', command = lambda: shuffle())
btn2 = Button(tk, text = 'Insertion Sort', bd = '5', command = lambda: IS())
btn3 = Button(tk, text = 'Selection Sort', bd = '5', command = lambda: SS())
btn4 = Button(tk, text = 'Merge Sort', bd = '5', command = lambda: MS())
btn5 = Button(tk, text = 'Quick Sort', bd = '5', command = lambda: QS(140-1))
btn6 = Button(tk, text = 'Heap Sort', bd = '5', command = lambda: HS())
btn7 = Button(tk, text = 'Radix Sort', bd = '5', command = lambda: RS())
btn8 = Button(tk, text = 'Bubble Sort', bd = '5', command = lambda: BS())
btn9 = Button(tk, text = 'Cocktail Sort', bd = '5', command = lambda: CS())
btn1.place(x = 710, y = 5)
btn2.place(x = 710, y = 65)
btn3.place(x = 710, y = 95)
btn4.place(x = 710, y = 125)
btn5.place(x = 710, y = 155)
btn6.place(x = 710, y = 185)
btn7.place(x = 710, y = 215)
btn8.place(x = 710, y = 245)
btn9.place(x = 710, y = 275)
tk.mainloop()