Sorting Algorithms
A Graphical User Interface written in Processing which allows the user to shuffle a random array of columns and then visualize different sorting algorithms in real time.
In this project I built a GUI in the Processing language which animates 9 classical sorting algorithms. I was inspired by the Coding Train’s YouTube video about Mergesort, so I decided to expand upon it. The repository can be found here so feel free to give it a try for yourself. When the program is up and running the user can press down on the shuffle button to generate a new random sequence of array elements. Then different sorting algorithms such as Quicksort, Mergesort, Selection Sort, etc. can be selected from and the algorithm is animated in real time with a red bar indicating the element currently being processed in the array.
Besides the 4 algorithms shown here on this page, the GUI also let’s the user play around with some less familiar options like Gnome sort or Pancake sort. However, I think the 4 shown here are the most visually unique. Note that animating an iterative algorithm such as selection sort is straight-forward since each frame in the animation just corresponds to a single iteration of the for-loop; however, animating a recursive algorithm is a little less intuitive. Doing so requires using a multi-threaded approach to store the state of the array at any given level in the recursive call.