Inspiration

When I was learning data structures and algorithms, I struggled a lot. Concepts were difficult to learn, and the only resource readily available were books and videos, which, despite helping massively, always led to "What If?" questions. A few years later, I decided to make a set of tools which helped others do easily what I struggled for so long with, beginning with sorting algorithms.

What it does

It helps learners understand the underlying concepts behind search algorithms by providing them with an effective visualization. You can customize the visualization in a myriad of ways, including its length, display color, speed, sorting algorithm, order to be arranged in, and the numbers in the array (to an extent). After you select these attributes and click visualize, a function yields every version of the array as it is sorted, which is converted into a series of graphs (through the use of Matplotlib) which play out one after the other, appearing as a video.

How I built it

I built it using raw Python (and Matplotlib and Tkinter) over a day. I started off by creating functions for each algorithm which sorted an array while yielding at the end of each iteration. I used these to create a console version, where the settings could be typed in and it would generate the graph video. Finally, I built the GUI for the visualizer using Tkinter.

Challenges we ran into

This was my first time using Tkinter, so I had a lot to learn. The positioning of different elements was especially difficult, as I had to place all of the elements in such a way there was a minimal amount of negative space used. Additionally, I had to get comfortable with using Matplotlib, and creating concatenations of graphs to appear as a video.

What's next for Sorting Algorithm Visualiser

The next step is to add functionality to be able to visualize various different types of algorithms, including search algorithms. I have started to work on this.

Built With

Share this project:

Updates