The Algorithm Visualizer is a Python application designed to visualize sorting algorithms. Currently, it supports Bubble Sort and Quick Sort. This tool is ideal for educational purposes, allowing users to see how these algorithms operate in real-time.
visualizer_demo.mp4
- Python 3.11
- Clone the repository to your local machine.
- Navigate to the project directory.
Execute the following command in the project directory:
python main.py
- Visual Representation: Visualize the sorting process in a graphical interface.
- Algorithm Selection: Choose between Bubble Sort and Quick Sort.
- Customization: Adjust the number of elements and the speed of visualization.
The application is built using the customtkinter
library for the GUI and is structured around the MainWindow
class.
- MainWindow Class: The central class that manages the GUI, including the sidebar and main frame for animation.
- Visualization: The sorting process is visualized on an animation canvas where each element's height represents its value.
- Controls: Play/Pause, Reset, and other controls are available in the sidebar to interact with the visualization.
- Performance Tracking: The application tracks and displays the number of comparisons and swaps made during the sorting process.
This project serves as a useful educational tool for understanding and visualizing sorting algorithms. Future enhancements will include:
- adding more algorithms
- improving the GUI
- refactoring components into their own classes
- adding pathfinding algorithms
- including sounds
- better animations