FatRat60 / AlgoVis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AlgoVis - Kyle Hultgren

Features

  • Press 1 - 4 in to switch between sorting methods
  • Implemented Sorts:
    • Bubble Sort
    • Merge Sort
    • Selection Sort
    • Insertion Sort
  • Press R to shufffle the array
  • Space Bar begins the sort
  • 3 threads: Render, Event handling, Sorting
  • Clicking github url in top right opens the repo in browser
  • K can be pressed during a sort to stop the sort prematurely
  • Fun animation played upon sort finishing
  • Displays number of swaps and array accesses in top left

Build Instructions

Fetch Content used for SFML making building locally as easy as cloning this repo and running the compile.sh script given that CMake is properly installed and configured on your machine. Upon successful build the compile script will run the project for you. The executable will be found in AlgoVis/build/

Example Pictures

Shuffled array awaiting to be sorted Screenshot taken in the middle of bubble sort Screenshot taken post sort. Animation has finished to all boxes are green Screenshot taken after aborting insertion sort early using K

Libraries used

  • SFML used for the rendering
  • CMake used for building project

External Code Used

Development Roadblocks

Originally the program allowed for window resizing however I ran into synchronization issues when resizing during a sort due to the event thread needing to recalculate the box sizes to fit the new window. I attempted to use a mutex to lock the array and stall the sort thread while the event thread handled the resizing but even still the boxes visually got messed up after the resize so I decided to remove resizing and limit the window to 800 x 600.

About

License:MIT License


Languages

Language:C++ 92.6%Language:CMake 5.8%Language:Shell 1.6%