gsv

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2017 License: MIT Imports: 9 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.

if you like, feel free to add more Sorting Algorithm examples. Many thanks to all contributors.

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

HeapSort

Heap Sort Animation

InsertionSort

Insertion Sort Animation

MergeSort

Merge Sort Animation

OddEvenSort

OddEven Sort Animation

QuickSort

Quick Sort Animation

ShellSort

Shell 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 HeapSort added in v0.10.0

func HeapSort(arr []int, frameGen FrameGen)

HeapSort https://en.wikipedia.org/wiki/Heapsort

func InsertionSort

func InsertionSort(arr []int, frameGen FrameGen)

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

func MergeSort added in v0.9.1

func MergeSort(arr []int, frameGen FrameGen)

MergeSort is an implementation of https://en.wikipedia.org/wiki/Merge_sort

func OddEvenSort

func OddEvenSort(arr []int, frameGen FrameGen)

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

func QuickSort added in v0.9.1

func QuickSort(arr []int, frameGen FrameGen)

QuickSort https://en.wikipedia.org/wiki/Quicksort

func SelectionSort

func SelectionSort(arr []int, frameGen FrameGen)

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

func ShellSort added in v0.10.0

func ShellSort(arr []int, frameGen FrameGen)

ShellSort is an implementation of https://en.wikipedia.org/wiki/Shellsort

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