This project is a visualization tool for understanding and demonstrating sorting algorithms. Built with Python and Pygame, the visualization dynamically displays the sorting process in real-time, providing an interactive way to learn sorting techniques.
-
Sorting Algorithms Supported:
- Bubble Sort
- Insertion Sort
-
Modes of Sorting:
- Ascending
- Descending
-
Keyboard Controls:
R
: Reset the arraySPACE
: Start SortingA
: Set sorting mode to AscendingD
: Set sorting mode to DescendingI
: Select Insertion SortB
: Select Bubble Sort
To run this project, make sure you have the following installed:
- Python 3.7+
- pip
- Pygame (Install via
pip install pygame
)
-
Clone this repository:
git clone https://github.com/your-username/sorting-visualization.git
-
Navigate to the project directory:
cd sorting-visualization
-
Install the required dependencies:
pip install pygame
Run the main Python file to start the visualization:
python main.py
The visualization window will open, and you can interact with it using the keyboard controls described above.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
- Commit your changes:
git commit -m "Description of changes"
- Push to your branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.