Skip to content

This project provides an interactive visualization of popular sorting algorithms using Python and the Pygame library. Watch as algorithms like Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, and Tim Sort transform an unsorted list into an ordered sequence right before your eyes.

License

Notifications You must be signed in to change notification settings

GermanPaul12/Sorting-Algorithm-Visualiser-PyGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Algorithm Visualization

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.

Sorting Algorithm Visualization

Table of Contents

Features

  • 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.

Installation

  1. Clone the repository:

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

    cd sorting-algorithm-visualization
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Run the main script:

    python main.py
  2. The visualization window will appear, displaying the initial unsorted list.

  3. Use the keyboard controls to select the sorting algorithm, sorting direction, and start the visualization.

Controls

  • 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.

Sorting Algorithms

This project supports the visualization of the following sorting algorithms:

  • Bubble Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Tim Sort

Contributing

Contributions to this project are welcome! If you have any suggestions, bug fixes, or improvements, please create a pull request or open an issue.

License

This project is licensed under the MIT License.

About

This project provides an interactive visualization of popular sorting algorithms using Python and the Pygame library. Watch as algorithms like Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, and Tim Sort transform an unsorted list into an ordered sequence right before your eyes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages