Giter Site home page Giter Site logo

sorting-visualizer's Introduction

๐Ÿ“Š Sorting Visualizer

A lightweight sorting visualizer made with C++ and SFML.

Quick sort gif
Quick sort
Bubble visualizer
Bubble sort
Bubble sort info
Bubble sort info

๐Ÿ“– I want to contribute to the project!

Awesome! Here you can find some useful info about the visualizer, we accept first contributors too!

Also, make sure to pull the last changes from dev branch!

๐Ÿ—‚๏ธ Sort types

  • Bubble sort
    • Bubble sort works by continuously swapping elements next to each other that are in the wrong place. Starting from the beginning of the dataset, each element 'floats' to its correct spot. More on Bubble sort can be found here.
  • Selection sort
    • Selection sort works by having two sections, the sorted and unsorted sections, and continuously search through the unsorted section and place the smallest element into the sorted section. This sorting algorithm could be implemented where the largest element is selected instead. More on selection sort can be found here.
  • Insertion sort
    • Insertion sort is similar to selection sort in that they both have a sorted and unsorted section. Instead of continuously selected the smallest/largest element, it will insert a selected element from the unsorted portion and 'insert' it into the correct spot in the sorted section. More on insertion sort can be found here.
  • Quick sort
    • Quick sort is a "Divide and Conquer" algorithm. Divide and Conquer algorithms work by splitting the problem into smaller portions, solving the smaller problems, then combing the solutions into one final solution. Quick sort works by choosing an element as a 'pivot', moving the other elements around where elements less than the pivot are on one side and elements greater than the pivot are on the other, then continuously doing that process with each side. Once each element has been partitioned, the solution is combined into the sorted array. More on quick sort can be found here and more on Divide and Conquer algorithms can be found here.
  • Cocktail shaker sort
    • Cocktail shaker sort is a variant of Bubble Sort. Instead of only having elements 'float' from the bottom to its correct spot in the dataset, elements also 'sink' from the top of the datset into its correct position. More on cocktail shaker sort can be found here.
  • Bogo sort
    • Bogo sort is an inefficient sorting algorithm where it randomly generates different versions of the original dataset and checks if it's sorted or not. More on bogo sort can be found here.
  • Bitonic sort
    • Bitonic sort is a comparison based sorting algorithm that can be run with parallel implementation. Within different subarrays, the algorithm checks if the first element is smaller than the second and vice versa. It continuously does that on larger subarrays until the whole dataset is sorted. More on bitonic sort can be found here.

๐Ÿ•น๏ธ Usage

  • Space: Start sort
  • Backspace: Stop sort
  • h: Display help
  • F1: Change number of elements
  • F2: Change time between comparisons
  • Arrow Up / Arrow down: Change sort type

๐Ÿ–จ๏ธ Download

Requirements:

  • CMake

๐Ÿง Linux

  • Clone the project: git clone https://github.com/alesbe/sorting-visualizer && cd sorting-visualizer
  • Run ./install.sh

๐Ÿ–ฅ๏ธ Windows / MacOS

The libraries included with the project only work with gcc compiler, for now, if you want to use it on Windows or macOS, you'll need to download sfml and compile the source code located in /src yourself.

sorting-visualizer's People

Contributors

alesbe avatar allcontributors[bot] avatar ariajanke avatar bazuin-32 avatar blueskeleton avatar forgotmycode avatar luki3122 avatar spwalgren avatar waahan 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.