GithubHelp home page GithubHelp logo

jowatersasc / sortvis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.32 MB

Sorting algorithm visualization with rendering in c++, SDL2, OpenGL, and ImGui

CMake 0.13% C 46.88% C++ 52.79% Objective-C 0.20%

sortvis's Introduction

SortVis

About

Provides a visualization of common sorting algorithms using ImGui, SDL2, and OpenGL. This project was created mostly as a learning exercise in c++ gui design by extending a few previously written sorting algorithms and is my first time working with gui's and threading in c++. Sorting Visualization

Sorting Algorithms Include:

  • Selection sort
  • Insertion sort
  • Bubble sort
  • Merge sort (iterative and recursive)
  • Quick sort (iterative and recursive)
  • Heap sort

Can choose which sorting algorithms to see working side by side and compare speeds as well as set the amount of elements to sort. Changing the duration of the thread's sleep in the waitTime() function in sorting_algos.h will slow down or speed up sorting time, allowing for better visualization.

Dependencies

  • Vanilla ImGui 1.72+
  • OpenGL
  • SDL2
  • C++17
  • CMake

Building/Installation

Clone repository in command line with:

git clone https://github.com/JoWatersASC/SortVis.git

Once cloned, navigate to build folder, run cmake, and build with make

cd SortVis/build/
cmake -S .. -B .
make

All files needed should be included in the include folder, but if you need to download SDL2 run

sudo apt install libsdl2-dev

on Linux. For Windows, go to the SDL2 GitHub and download the zip file and extract.

If running on Windows, a Visual Studio solution will be created, simply open and run. If on Linux, an executable will be created and can be ran automatically.

To Be Added

  • Cursor that tracks which element(s) is(are) being modified/compared
  • Pausing and step-by-step incrementation of algorithms

sortvis's People

Contributors

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