Sorting-Visualizer-In-Python is an interactive tool that visualizes different sorting algorithms using the Pygame library. It provides a clear, graphical representation of how sorting algorithms work, making it easier to understand and learn about various sorting techniques.
- Real-time Visualization: See sorting algorithms in action with real-time updates.
- Multiple Sorting Algorithms: Supports Bubble Sort, Selection Sort, and Insertion Sort.
- Customizable Speed: Adjust the speed of the sorting animation using a slider.
- User-friendly Interface: Intuitive buttons to select sorting algorithms.
To get started with Sorting-Visualizer-In-Python, follow these steps:
-
Clone the Repository:
git clone https://github.com/gag3301v/Sorting-Visualizer-In-Python.git cd Sorting-Visualizer-In-Python -
Install Dependencies:
pip install pygame
Here's how you can use the program:
# Import necessary modules
import pygame
from algo_test import bubble_sort, selection_sort, insertion_sort
from SortingVisualizer import SortingVisualizer
# Initialize Pygame
pygame.init()
# Create a sorting visualizer instance
visualizer = SortingVisualizer()
# Run the visualization
visualizer.run()No additional configuration is required. The program handles all necessary settings internally.
To run tests, ensure you have the required dependencies installed and execute:
pytest algo_test.pyThe project structure is as follows:
Sorting-Visualizer-In-Python/
βββ SortingAlgorithms.py
βββ SortingVisualizer.py
βββ main.py
βββ README.md
Contributions are welcome! Please follow these guidelines:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeatureName). - Make your changes and commit them (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeatureName). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This README template is designed to be adaptable and informative. Feel free to modify it according to your specific needs and add any additional sections or information that may be relevant to your project.