Giter Site home page Giter Site logo

yamansd / sortingvisualizer Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 77 KB

Sorting algorithms visualizer built using PyQT5

License: MIT License

Python 100.00%
pyqt pyqt5 python sorting-algorithm-visualizations sorting-algorithms sorting-visualizer

sortingvisualizer's Introduction

SortingVisualizer

Python Qt

The SortingVisualizer project is a sorting algorithms visualizer that provides a graphical demonstration of how various sorting algorithms work. With a user-friendly GUI, it allows users to interactively observe the sorting process.

This project is heavily inspired by Bingmann's Sounds of Sorting

SortingVisualizer Screenshot 1

Installation

To install and set up the SortingVisualizer project, follow these steps:

  1. Make sure you have Python 3.9 or later installed on your machine.
  2. Clone the project repository: git clone https://github.com/your-username/SortingVisualizer.git
  3. Change into the project directory: cd SortingVisualizer
  4. Install the required dependencies using pip: pip install -r requirements.txt

Usage

  • Once the project is installed, you run the main.py file by: python3 main.py

  • The visualizer's GUI will be displayed, allowing you to interact with the sorting algorithms.

Features

The GUI provides the following controls:

  • Start/Stop: Control the execution of the current sorting algorithm.
  • Shuffle Array: Randomly shuffle the elements in the array.
  • Resize Array: Change the size of the array to be sorted.
  • Change Sorting Algorithm: Select from a list of supported sorting algorithms.
  • Positive Integers or Positives/Negatives: Choose whether to allow positive integers only or both positive and negative integers.
  • Customize Display Colors: Modify the colors of the displayed elements, such as bar colors and background colors.

Supported Sorting Algorithms

The SortingVisualizer includes the following sorting algorithms:

  • Bogo Sort
  • Bubble Sort
  • Shaker Sort
  • Insertion Sort
  • Binary Insertion Sort
  • Gnome Sort
  • Brick Sort
  • Selection Sort
  • Comb Sort
  • Shell Sort
  • Heap Sort
  • Tim Sort
  • Bim Sort
  • Qim Sort
  • M-Qim Sort
  • Merge Sort
  • Intro Sort
  • Quick Sort
  • Middle Quick Sort
  • Hybrid QSort
  • Hybrid QSort v2
  • Radix Sort
  • Radix Sort v2

Please note that some of these algorithms are custom implementations.

Known Issues

  • No sound generation is included.
  • The visualizer works best with in-place sorting algorithms. Radix sorts "break" the array while sorting.
  • The code structure and comments are not optimal due to the project being the developer's first experience.

Contributing

Contributions to the SortingVisualizer project are welcome! If you would like to contribute, please follow these steps:

  1. Fork the project repository.
  2. Create a new branch for your contribution.
  3. Make your changes and commit them with clear and descriptive messages.
  4. Push your changes to your forked repository.
  5. Submit a pull request, describing the purpose and details of your contribution.

License

The SortingVisualizer project is licensed under the MIT License.

sortingvisualizer's People

Contributors

yamansd avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.