package sort

Import Path
	sort (on golang.org and go.dev)

Dependency Relation
	imports one package, and imported by 38 packages

Involved Source Files
	    search.go
	    slice.go
	    slice_go113.go
	d-> sort.go
	    zfuncversion.go

Exported Type Names

type Float64Slice ([]) Float64Slice attaches the methods of Interface to []float64, sorting in increasing order (not-a-number values are treated as less than other values). (T) Len() int (T) Less(i, j int) bool (T) Search(x float64) int (T) Sort() (T) Swap(i, j int) T : Interface
type Interface (interface) A type, typically a collection, that satisfies sort.Interface can be sorted by the routines in this package. The methods require that the elements of the collection be enumerated by an integer index. (T) Len() int (T) Less(i, j int) bool (T) Swap(i, j int) Float64Slice IntSlice StringSlice container/heap.Interface (interface) go/scanner.ErrorList internal/fmtsort.(*SortedMap) func Reverse(data Interface) Interface func IsSorted(data Interface) bool func Reverse(data Interface) Interface func Sort(data Interface) func Stable(data Interface)
type IntSlice ([]) IntSlice attaches the methods of Interface to []int, sorting in increasing order. (T) Len() int (T) Less(i, j int) bool (T) Search(x int) int (T) Sort() (T) Swap(i, j int) T : Interface
type StringSlice ([]) StringSlice attaches the methods of Interface to []string, sorting in increasing order. (T) Len() int (T) Less(i, j int) bool (T) Search(x string) int (T) Sort() (T) Swap(i, j int) T : Interface
Exported Values
func Float64s(a []float64) Float64s sorts a slice of float64s in increasing order (not-a-number values are treated as less than other values).
func Float64sAreSorted(a []float64) bool Float64sAreSorted tests whether a slice of float64s is sorted in increasing order (not-a-number values are treated as less than other values).
func Ints(a []int) Ints sorts a slice of ints in increasing order.
func IntsAreSorted(a []int) bool IntsAreSorted tests whether a slice of ints is sorted in increasing order.
func IsSorted(data Interface) bool IsSorted reports whether data is sorted.
func Reverse(data Interface) Interface Reverse returns the reverse order for data.
func SearchFloat64s(a []float64, x float64) int SearchFloat64s searches for x in a sorted slice of float64s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.
func SearchInts(a []int, x int) int SearchInts searches for x in a sorted slice of ints and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.
func SearchStrings(a []string, x string) int SearchStrings searches for x in a sorted slice of strings and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.
func Slice(slice interface{}, less func(i, j int) bool) Slice sorts the provided slice given the provided less function. The sort is not guaranteed to be stable. For a stable sort, use SliceStable. The function panics if the provided interface is not a slice.
func SliceIsSorted(slice interface{}, less func(i, j int) bool) bool SliceIsSorted tests whether a slice is sorted. The function panics if the provided interface is not a slice.
func SliceStable(slice interface{}, less func(i, j int) bool) SliceStable sorts the provided slice given the provided less function while keeping the original order of equal elements. The function panics if the provided interface is not a slice.
func Sort(data Interface) Sort sorts data. It makes one call to data.Len to determine n, and O(n*log(n)) calls to data.Less and data.Swap. The sort is not guaranteed to be stable.
func Stable(data Interface) Stable sorts data while keeping the original order of equal elements. It makes one call to data.Len to determine n, O(n*log(n)) calls to data.Less and O(n*log(n)*log(n)) calls to data.Swap.
func Strings(a []string) Strings sorts a slice of strings in increasing order.
func StringsAreSorted(a []string) bool StringsAreSorted tests whether a slice of strings is sorted in increasing order.