Skip to content

Simret101/Sorting_Algorithm_Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Algorithm Visualization

Sorting Algorithm Visualization

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.


Features

  • Sorting Algorithms Supported:

    • Bubble Sort
    • Insertion Sort
  • Modes of Sorting:

    • Ascending
    • Descending
  • Keyboard Controls:

    • R: Reset the array
    • SPACE: Start Sorting
    • A: Set sorting mode to Ascending
    • D: Set sorting mode to Descending
    • I: Select Insertion Sort
    • B: Select Bubble Sort

Prerequisites

To run this project, make sure you have the following installed:

  • Python 3.7+
  • pip
  • Pygame (Install via pip install pygame)

Demo Overview

Alt Text


Installation

  1. Clone this repository:

    git clone https://github.com/your-username/sorting-visualization.git
  2. Navigate to the project directory:

    cd sorting-visualization
  3. Install the required dependencies:

    pip install pygame

How to Run

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.


Contribution

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m "Description of changes"
  4. Push to your branch:
    git push origin feature-name
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgements

  • Built using Python and Pygame.
  • Inspired by the need for interactive learning tools in algorithms.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published