This project visualizes various sorting algorithms using Python and Tkinter. It provides an interactive way to observe how different sorting algorithms work by visualizing the array's transformations through colored bars.
The Sorting Visualizer helps you visualize how various sorting algorithms work. You can watch each step of the sorting process in real-time with visual indicators:
- Red bars represent the elements that are currently being compared.
- White bars represent the elements that are not yet sorted.
- Green bars represent that all elements are sorted now.
The visualizer includes multiple sorting algorithms, allowing you to compare and analyze their performance.
The Sorting Visualizer currently supports the following sorting algorithms:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
Each algorithm is visualized step-by-step, showing how the array is manipulated during the sorting process.
Before you can run the visualizer, you need to have Tkinter installed, as it is used to create the GUI for visualizing the sorting algorithms.
-
Tkinter comes pre-installed with Python. If you don’t have it, download Python from the official Python website and make sure to select the option to install Tkinter during installation.
-
To check if Tkinter is installed, open a terminal/command prompt and run:
python -m tkinter
-
Clone the repositiory:
git clone https://github.com/pragya79/tkinter-sort-visualizer.git
- Open a terminal or command prompt.
- Navigate to the directory where the project is located.
- Run the following command to start the Sorting Visualizer:
python visualizer.py
- The GUI will open, and you will be able to select a sorting algorithm from the dropdown list.
- Click the "Sort" button to visualize the sorting process.