sorters

package
v0.0.0-...-7624532 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootIndex int = 1
	Down      int = 0
	Up        int = 1
)

Variables

This section is empty.

Functions

func AreIdentical

func AreIdentical[T comparable](x, y []T) bool

func BubbleSort

func BubbleSort[T constraints.Ordered](toSort []T)

func CocktailShakerSort

func CocktailShakerSort[T constraints.Ordered](toSort []T)

func GetMergeSort

func GetMergeSort[T constraints.Ordered](smallSorter func([]T)) func([]T)

func HeapSort

func HeapSort[T constraints.Ordered](toSort []T)

func InsertionSort

func InsertionSort[T constraints.Ordered](toSort []T)

func IsSorted

func IsSorted[T constraints.Ordered](ary []T) bool

func QuickSort

func QuickSort[T constraints.Ordered](toSort []T)

func SelectionSort

func SelectionSort[T constraints.Ordered](toSort []T)

func SwapValues

func SwapValues[T any](ary []T, x, y int)

Types

type Heap

type Heap[T constraints.Ordered] struct {
	// contains filtered or unexported fields
}

type HeapNode

type HeapNode[T constraints.Ordered] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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