Documentation ¶
Overview ¶
Package GoSort functions and other helpful libraries for Sorting Algorithms
See Readme.md for more info.
Example (SortingAlgorithms) ¶
begin := 24 end := 34 arr := []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ := gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("GnomeSort") sortObject.GnomeSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("InsertionSort") sortObject.InsertionSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("SlowSort") sortObject.SlowSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("SelectionSort") sortObject.SelectionSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("SillySort") sortObject.SillySort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("QuickSort") sortObject.QuickSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("MergeSort") sortObject.MergeSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("HeapSort -> revisar el sub array") sortObject.HeapSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("TimSort") sortObject.TimSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("TreeSort") sortObject.TreeSort(begin, sortObject.Len()-end, func(a interface{}) interface{} { return a }) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("BubbleSort") sortObject.BubbleSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("CockTailSort") sortObject.CockTailSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("ShellSort") sortObject.ShellSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("CombSort") sortObject.CombSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("CycleSort") sortObject.CycleSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("CircleSort") sortObject.CircleSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("BrickSort") sortObject.BrickSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSort(arr, goutils.IntComparator) fmt.Println("SleepSort -> revisar el algoritmo") sortObject.SleepSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("BucketSort") sortObject.BucketSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("PigeonHoleSort") sortObject.PigeonHoleSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("CountingSort") sortObject.CountingSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("StoogeSort") sortObject.StoogeSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("PancakeSort") sortObject.PancakeSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("IntroSort") sortObject.IntroSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("BitonicSort") sortObject.BitonicSort(0, sortObject.Len()) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("PermutationSort") sortObject.PermutationSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n") arr = []interface{}{10, 6, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 10, 3, 5, 8, 8, 3, 2, 7, 4, 8, 8, 3, 2, 7, 4, 6, 8, 8, 3, 2, 7, 4, 9, 11, 10, 9, 6, 8, 8, 3, 5, 5, 7, 8, 15, 49, 65, 2} sortObject, _ = gosort.NewGoSortOp(arr, goutils.IntComparator, goutils.IntOperator) fmt.Println("BogoSort") sortObject.BogoSort(begin, sortObject.Len()-end) fmt.Println("Is Ordered ? ", arr) fmt.Println("Is Ordered ? ", sortObject.IsSorted(), "\n\n")
Output:
Index ¶
- Variables
- type GoSort
- func (s *GoSort) BitonicSort(low, high int)
- func (s *GoSort) BogoSort(low, high int)
- func (s *GoSort) BrickSort(low, high int)
- func (s *GoSort) BubbleSort(low, high int)
- func (s *GoSort) BucketSort(low, high int)
- func (s *GoSort) CircleSort(low, high int)
- func (s *GoSort) CockTailSort(low, high int)
- func (s *GoSort) CombSort(low, high int)
- func (s *GoSort) CountingSort(low, high int)
- func (s *GoSort) CycleSort(low, high int)
- func (s *GoSort) EqualsThan(i, j int) bool
- func (s *GoSort) FindMaxElementAndIndex() (interface{}, int)
- func (s *GoSort) FindMinElementAndIndex() (interface{}, int)
- func (s *GoSort) GnomeSort(low, high int)
- func (s *GoSort) GoSort()
- func (s *GoSort) GreaterEqualsThan(i, j int) bool
- func (s *GoSort) GreaterThan(i, j int) bool
- func (s *GoSort) HeapSort(low, high int)
- func (s *GoSort) InsertionSort(low, high int)
- func (s *GoSort) IntroSort(low, high int)
- func (s *GoSort) IsSorted() bool
- func (s *GoSort) IsSortedPart(begin, end int) bool
- func (s *GoSort) Len() int
- func (s *GoSort) Less(i, j int) bool
- func (s *GoSort) LessEqualsThan(i, j int) bool
- func (s *GoSort) LessThan(i, j int) bool
- func (s *GoSort) MergeSort(low, high int)
- func (s *GoSort) PancakeSort(low, high int)
- func (s *GoSort) PermutationSort(low, high int)
- func (s *GoSort) PigeonHoleSort(low, high int)
- func (s *GoSort) QuickSort(low, high int)
- func (s *GoSort) SelectionSort(low, high int)
- func (s *GoSort) ShellSort(low, high int)
- func (s *GoSort) ShuffleSort(low, high int)
- func (s *GoSort) SillySort(low, high int)
- func (s *GoSort) SleepSort(low, high int)
- func (s *GoSort) SlowSort(low, high int)
- func (s *GoSort) StoogeSort(low, high int)
- func (s *GoSort) SubArray(low, high int) *GoSort
- func (s *GoSort) Swap(i, j int)
- func (s *GoSort) TimSort(low, high int)
- func (s *GoSort) TreeSort(low, high int, f func(interface{}) interface{})
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var (
GoSortEmptyArray = errors.New("Invalid Empty Array to Sort.\n")
)
Functions ¶
This section is empty.
Types ¶
type GoSort ¶
type GoSort struct {
// contains filtered or unexported fields
}
GoSort object
func NewGoSort ¶
func NewGoSort(arr []interface{}, comp goutils.TypeComparator) (*GoSort, error)
new GoSort
func NewGoSortOp ¶
func NewGoSortOp(arr []interface{}, comp goutils.TypeComparator, op goutils.TypeOperator) (*GoSort, error)
func (*GoSort) BitonicSort ¶
Call BitonicSort from HardSort package Run as BitonicSort(begin, end), (end-high) must be a power of 2.
func (*GoSort) BubbleSort ¶
Call BubbleSort from SwapSort package Run as BubbleSort(begin, end)
func (*GoSort) BucketSort ¶
Call BucketSort from DistributionSort package Run as BucketSort(begin, end)
func (*GoSort) CircleSort ¶
Call CircleSort from SwapSort package Run as CircleSort(begin, end)
func (*GoSort) CockTailSort ¶
Call CockTailSort from SwapSort package Run as CockTailSort(begin, end)
func (*GoSort) CountingSort ¶
Call CountingSort from DistributionSort package Run as CountingSort(begin, end)
func (*GoSort) FindMaxElementAndIndex ¶
find the max element and respective index
func (*GoSort) FindMinElementAndIndex ¶
find the min element and respective index
func (*GoSort) GoSort ¶
func (s *GoSort) GoSort()
Sort sorts values (in-place) with respect to the given comparator.
func (*GoSort) GreaterEqualsThan ¶
return if is greater or equals
func (*GoSort) InsertionSort ¶
Call InsertionSort from SimpleSort package Run as InsertionSort(begin, end)
func (*GoSort) IsSortedPart ¶
return True if is sorted in this part
func (*GoSort) LessEqualsThan ¶
return if is less or equals
func (*GoSort) PancakeSort ¶
Call PancakeSort from HardSort package Run as PancakeSort(begin, end)
func (*GoSort) PermutationSort ¶
Call PermutationSort from SwapSort package Run as PermutationSort(begin, end)
func (*GoSort) PigeonHoleSort ¶
Call PigeonHoleSort from DistributionSort package Run as PigeonHoleSort(begin, end)
func (*GoSort) SelectionSort ¶
Call SelectionSort from SimpleSort package Run as SelectionSort(begin, end)
func (*GoSort) ShuffleSort ¶
Call BucketSort from DistributionSort package Run as BucketSort(begin, end)
func (*GoSort) StoogeSort ¶
Call StoogeSort from HardSort package Run as StoogeSort(begin, end)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package of Distribution Sort Algorithms See Readme.md for more info.
|
Package of Distribution Sort Algorithms See Readme.md for more info. |
Package of Efficient Sort Algorithms See Readme.md for more info.
|
Package of Efficient Sort Algorithms See Readme.md for more info. |
Package of Hard Sort Algorithms See Readme.md for more info.
|
Package of Hard Sort Algorithms See Readme.md for more info. |
Package of Parallel Sort Algorithms See Readme.md for more info.
|
Package of Parallel Sort Algorithms See Readme.md for more info. |
Package of Simple Sort Algorithms See Readme.md for more info.
|
Package of Simple Sort Algorithms See Readme.md for more info. |
Package of Swap Sort Algorithms See Readme.md for more info.
|
Package of Swap Sort Algorithms See Readme.md for more info. |