Visualsort borns as a program to exploit the capabilities of Pixel gaming library (and having fun with Go).
It's aim is to provide a visual representation of the most popular in-memory sorting algorithms (Wikipedia).
Demo video on Youtube.
- Quick Sort: I effectively use the Go Lib implementation that should be a randomized version
- Bubble Sort
- Bubble Sort 2: fast end
- Insertion Sort
- Selection Sort
- Shell Sort
- Cocktail Sort
- Merge Sort
Visualsort is a command line utility.
Just run visualsort
to get a visual representation of quicksort (one of the best algorithm (not the "best" in the sense it's not an "optimal" solution for the problem of "in-memory sorting") implemented in many system libraries.
You can customize speed, delay, algorithm, data set and many more options for the sake of your experiments.
For a complete list of options issue the interactive help: visualsort -h
.
Some of them are treated here:
- asc: will use a data set ordered in ascending
- desc: will use a data set ordered in descending
- delay: will retard the the start of the game by an amount of seconds. Useful for video recording
- seed: set a random seed. Useful to compare algorithms with similar data sets
- size: the size of the data set
- speed: the speed of the animation
It would suffice
go get github.com/MrBogomips/visualsort
This project started for fun to explore Go and Pixel gaming library. The code should deserve better organization and many more algos (notably Mergesort).
Neverthless… if you found another sorting algorithm to share…