Skip to content

A visual representation of sorting algorithms: for fun and education

Notifications You must be signed in to change notification settings

MrBogomips/visualsort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visualsort

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

Screenshots

Quicksort Screenshot

Demo video on Youtube.

Algorightms

  • 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

Usage

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.

Command Options

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

Installation

It would suffice

 go get github.com/MrBogomips/visualsort

Contribution

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…