-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
89 lines (45 loc) · 1.91 KB
/
Copy pathmain.py
File metadata and controls
89 lines (45 loc) · 1.91 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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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 bucket_sort import sort as BuS
from shell_sort import sort as SS
from tim_sort import sort as TiS
from OFA import *
tk.title("Sorting Visualized")
generate()
net_blocks_var = Variable(tk, value= 140)
net_blocks = lambda: int(net_blocks_var.get())
inputBox = Entry(tk, textvariable= net_blocks_var)
enter = Button(tk, text= 'Enter', bd= '5', command= lambda: reset(net_blocks()))
btn1 = Button(tk, text='Shuffle', bd='5', command=lambda: shuffle(net_blocks()))
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(net_blocks() - 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())
btn10 = Button(tk, text = 'Shell Sort', bd = '5', command = lambda: SS())
btnAmbareen = Button(tk, text='Bucket Sort', bd='5', command=lambda: BuS())
btnAman = Button(tk, text='Tim Sort', bd='5', command=lambda: TiS())
btn1.place(x=710, y=5)
inputBox.place(x=710, y=45)
enter.place(x= 710, y= 70)
btn2.place(x=710, y=115)
btn3.place(x=710, y=145)
btn4.place(x=710, y=175)
btn5.place(x=710, y=205)
btn6.place(x=710, y=235)
btn7.place(x=710, y=265)
btn8.place(x=710, y=295)
btn9.place(x=710, y=325)
btn10.place(x = 710, y=355)
btnAmbareen.place(x=710, y=385)
btnAman.place(x=710, y=415)
tk.mainloop()