-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (27 loc) · 1.12 KB
/
main.py
File metadata and controls
40 lines (27 loc) · 1.12 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
import tkinter as tk
from tkinter import ttk
def main():
root = tk.Tk()
root.title("Algorithm Visualizer")
root.geometry("1200x800")
# Create notebook for different algorithm types
notebook = ttk.Notebook(root)
notebook.pack(fill=tk.BOTH, expand=True)
# Import algorithm visualizers
from algorithms.tree_traversal import TreeTraversalVisualizer
from algorithms.bubble_sort import BubbleSortVisualizer
from algorithms.insertion_sort import InsertionSortVisualizer
# Create tabs for each algorithm type
tree_frame = ttk.Frame(notebook)
bubble_frame = ttk.Frame(notebook)
insertion_frame = ttk.Frame(notebook)
notebook.add(tree_frame, text="Tree Traversal")
notebook.add(bubble_frame, text="Bubble Sort")
notebook.add(insertion_frame, text="Insertion Sort")
# Initialize visualizers in their respective tabs
tree_vis = TreeTraversalVisualizer(tree_frame)
bubble_vis = BubbleSortVisualizer(bubble_frame)
insertion_vis = InsertionSortVisualizer(insertion_frame)
root.mainloop()
if __name__ == "__main__":
main()