This project provides a graphical visualization of various sorting algorithms using the Pygame library. It demonstrates how different sorting algorithms work and allows you to observe their behavior in real-time.
- Visualization of Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, and Tim Sort.
- Real-time visualization with adjustable animation speed.
- Choose between ascending and descending sorting.
- Reset functionality to generate a new random list.
- Interactive keyboard controls for easy navigation.
-
Clone the repository:
git clone https://github.com/GermanPaul12/sorting-algorithm-visualization.git
-
Navigate to the project directory:
cd sorting-algorithm-visualization
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the main script:
python main.py
-
The visualization window will appear, displaying the initial unsorted list.
-
Use the keyboard controls to select the sorting algorithm, sorting direction, and start the visualization.
- R: Reset the list with a new random order.
- SPACE: Start or stop the sorting visualization.
- A: Sort in ascending order.
- D: Sort in descending order.
- I: Choose Insertion Sort.
- B: Choose Bubble Sort.
- M: Choose Merge Sort.
- Q: Choose Quick Sort.
- T: Choose Tim Sort.
This project supports the visualization of the following sorting algorithms:
- Bubble Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Tim Sort
Contributions to this project are welcome! If you have any suggestions, bug fixes, or improvements, please create a pull request or open an issue.
This project is licensed under the MIT License.