This project visualizes three sorting algorithms: Bubble Sort, Insertion Sort, and Bogo Sort using Pygame. It allows you to interactively visualize how these algorithms sort a randomly generated list of integers.
- Python 3
- Pygame library
- Clone the repository:
git clone https://github.com/HabibOmar/sorting-algorithm-visualizer.git cd sorting-algorithim-visualizer
pip install pygame
Run the main.py file to start the visualization.
You can use the arrow keys to select number of array elements: 5, 10, 20, 40, 50, 80, 100
Then click Enter to go to the visualizing page.
You can control the sorting process with the following keys:
- R: Reset the list with new random values.
- SPACE: Start sorting using the selected algorithm.
- A: Sort in ascending order.
- D: Sort in descending order.
- B: Select Bubble Sort.
- I: Select Insertion Sort.
- G: Select Bogo Sort.
Thanks to Pygame for providing a simple and effective way to create graphical applications in Python. Inspired by educational resources on sorting algorithms.