gsv

package module
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2017 License: MIT Imports: 8 Imported by: 0

README

GolangSortingVisualization

Codacy Badge Coverage Status Build Status Go Report Card codebeat badge

this sorting visualization is not intended to recommend any algorithm, if you need a recommendation go somewhere else.

Sorting Algorithms

BogoSort

Bogo Sort Animation

BubbleSort

Bubble Sort Animation

CocktailSort

Cocktail Sort Animation

CombSort

Comb Sort Animation

CountingSort

Counting Sort Animation

GnomeSort

Gnome Sort Animation

InsertionSort

Insertion Sort Animation

OddEvenSort

OddEven Sort Animation

SelectionSort

Selection Sort Animation

StoogeSort

Stooge Sort Animation

HowTo

./start.sh
$ go run gsv.go --help
Usage of gsv:
  -algo="bubble": Select sorting algorithm all/bogo/[bubble]/comb/counting/gnome/insertion/oddEven/selection/sleep
  -count=30: number of values
  -fps=10: frames per second
  -max=9: highest value
  -mode=1: visualization mode
  -vis="stdout": Select output: [stdout]/gif

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Count int
View Source
var Fps int
View Source
var Max int
View Source
var Mode int

Functions

func BogoSort

func BogoSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Bogosort

func BubbleSort

func BubbleSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Bubble_sort

func CombSort

func CombSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Comb_sort

func CountingSort

func CountingSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Counting_sort

func GnomeSort

func GnomeSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Gnome_sort

func InsertionSort

func InsertionSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Insertion_sort

func OddEvenSort

func OddEvenSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Odd–even_sort

func SelectionSort

func SelectionSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Selection_sort

func SleepSort

func SleepSort(arr []int, frameGen FrameGen)

NOT ON WIKIPEDIA

func StoogeSort

func StoogeSort(arr []int, frameGen FrameGen)

https://en.wikipedia.org/wiki/Stooge_sort

func WriteGif

func WriteGif(name string, g *gif.GIF)

func WriteStdout

func WriteStdout(arr []int)

Types

type FrameGen

type FrameGen func([]int)

func (FrameGen) AddFrame

func (fg FrameGen) AddFrame(arr []int)

func (FrameGen) Complete

func (fg FrameGen) Complete()

func (FrameGen) Setup

func (fg FrameGen) Setup(name string)

type GifVisualizer

type GifVisualizer struct {
	// contains filtered or unexported fields
}

func (*GifVisualizer) AddFrame

func (gv *GifVisualizer) AddFrame(arr []int)

func (*GifVisualizer) Complete

func (gv *GifVisualizer) Complete()

func (*GifVisualizer) Setup

func (gv *GifVisualizer) Setup(name string)

type Sorter

type Sorter func([]int, FrameGen)

type Visualizer

type Visualizer interface {
	Setup(string)
	AddFrame([]int)
	Complete()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL