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
To install and set up the SortingVisualizer project, follow these steps:
- Make sure you have Python 3.9 or later installed on your machine.
- Clone the project repository:
git clone https://github.com/your-username/SortingVisualizer.git
- Change into the project directory:
cd SortingVisualizer
- Install the required dependencies using pip:
pip install -r requirements.txt
-
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.
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.
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.
- 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.
Contributions to the SortingVisualizer project are welcome! If you would like to contribute, please follow these steps:
- Fork the project repository.
- Create a new branch for your contribution.
- Make your changes and commit them with clear and descriptive messages.
- Push your changes to your forked repository.
- Submit a pull request, describing the purpose and details of your contribution.
The SortingVisualizer project is licensed under the MIT License.