sort

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: CC0-1.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParallelSort

func ParallelSort(S sort.Interface, T ...Swapper)

ParallelSort sorts the given arguments in parallel. S is placed in increasing order, whilst the entries in each of the T[i] are permuted accordingly. The T[i] must have length greater than or equal to the length of S, otherwise this may panic.

func ParallelStable

func ParallelStable(S sort.Interface, T ...Swapper)

ParallelStable stable sorts the given arguments in parallel. S is placed in increasing order, whilst the entries in each of the T[i] are permuted accordingly. The T[i] must have length greater than or equal to the length of S, otherwise this may panic.

func SearchInt16s

func SearchInt16s(a []int16, x int16) int

SearchInt16s searches for x in a sorted slice of int16s and returns the index as specified by sort.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 SearchInt32s

func SearchInt32s(a []int32, x int32) int

SearchInt32s searches for x in a sorted slice of int32s and returns the index as specified by sort.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 SearchInt64s

func SearchInt64s(a []int64, x int64) int

SearchInt64s searches for x in a sorted slice of int64s and returns the index as specified by sort.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 SearchInt8s

func SearchInt8s(a []int8, x int8) int

SearchInt8s searches for x in a sorted slice of int8s and returns the index as specified by sort.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

func SearchInts(a []int, x int) int

SearchInts searches for x in a sorted slice of ints and returns the index as specified by sort.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. Note that this is duplicated from the "sort" package for convenience.

func SearchUint16s

func SearchUint16s(a []uint16, x uint16) int

SearchUint16s searches for x in a sorted slice of uint16s and returns the index as specified by sort.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 SearchUint32s

func SearchUint32s(a []uint32, x uint32) int

SearchUint32s searches for x in a sorted slice of uint32s and returns the index as specified by sort.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 SearchUint64s

func SearchUint64s(a []uint64, x uint64) int

SearchUint64s searches for x in a sorted slice of uint64s and returns the index as specified by sort.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 SearchUint8s

func SearchUint8s(a []uint8, x uint8) int

SearchUint8s searches for x in a sorted slice of uint8s and returns the index as specified by sort.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 SearchUints

func SearchUints(a []uint, x uint) int

SearchUints searches for x in a sorted slice of uints and returns the index as specified by sort.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.

Types

type Float64Slice

type Float64Slice []float64

Float64Slice attaches the methods of Interface to []float64, sorting in increasing order.

func (Float64Slice) Len

func (p Float64Slice) Len() int

func (Float64Slice) Less

func (p Float64Slice) Less(i, j int) bool

func (Float64Slice) Sort

func (p Float64Slice) Sort()

Sort is a convenience method.

func (Float64Slice) Swap

func (p Float64Slice) Swap(i, j int)

type Int16Slice

type Int16Slice []int16

Int16Slice attaches the methods of Interface to []int16, sorting in increasing order.

func (Int16Slice) Len

func (p Int16Slice) Len() int

func (Int16Slice) Less

func (p Int16Slice) Less(i, j int) bool

func (Int16Slice) Sort

func (p Int16Slice) Sort()

Sort is a convenience method.

func (Int16Slice) Swap

func (p Int16Slice) Swap(i, j int)

type Int32Slice

type Int32Slice []int32

Int32Slice attaches the methods of Interface to []int32, sorting in increasing order.

func (Int32Slice) Len

func (p Int32Slice) Len() int

func (Int32Slice) Less

func (p Int32Slice) Less(i, j int) bool

func (Int32Slice) Sort

func (p Int32Slice) Sort()

Sort is a convenience method.

func (Int32Slice) Swap

func (p Int32Slice) Swap(i, j int)

type Int64Slice

type Int64Slice []int64

Int64Slice attaches the methods of Interface to []int64, sorting in increasing order.

func (Int64Slice) Len

func (p Int64Slice) Len() int

func (Int64Slice) Less

func (p Int64Slice) Less(i, j int) bool

func (Int64Slice) Sort

func (p Int64Slice) Sort()

Sort is a convenience method.

func (Int64Slice) Swap

func (p Int64Slice) Swap(i, j int)

type Int8Slice

type Int8Slice []int8

Int8Slice attaches the methods of Interface to []int8, sorting in increasing order.

func (Int8Slice) Len

func (p Int8Slice) Len() int

func (Int8Slice) Less

func (p Int8Slice) Less(i, j int) bool

func (Int8Slice) Sort

func (p Int8Slice) Sort()

Sort is a convenience method.

func (Int8Slice) Swap

func (p Int8Slice) Swap(i, j int)

type IntSlice

type IntSlice []int

IntSlice attaches the methods of Interface to []int, sorting in increasing order. Note that this is duplicated from the "sort" package for convenience.

func (IntSlice) Len

func (p IntSlice) Len() int

func (IntSlice) Less

func (p IntSlice) Less(i, j int) bool

func (IntSlice) Sort

func (p IntSlice) Sort()

Sort is a convenience method.

func (IntSlice) Swap

func (p IntSlice) Swap(i, j int)

type Lesser

type Lesser interface {
	Less(i, j int) bool // Less reports whether the element with index i should sort before the element with index j.
}

Lesser defines the Less method.

type Swapper

type Swapper interface {
	Swap(i, j int) // Swap exchanges the i-th and j-th elements.
}

Swapper defines the Swap method.

type Uint16Slice

type Uint16Slice []uint16

Uint16Slice attaches the methods of Interface to []uint16, sorting in increasing order.

func (Uint16Slice) Len

func (p Uint16Slice) Len() int

func (Uint16Slice) Less

func (p Uint16Slice) Less(i, j int) bool

func (Uint16Slice) Sort

func (p Uint16Slice) Sort()

Sort is a convenience method.

func (Uint16Slice) Swap

func (p Uint16Slice) Swap(i, j int)

type Uint32Slice

type Uint32Slice []uint32

Uint32Slice attaches the methods of Interface to []uint32, sorting in increasing order.

func (Uint32Slice) Len

func (p Uint32Slice) Len() int

func (Uint32Slice) Less

func (p Uint32Slice) Less(i, j int) bool

func (Uint32Slice) Sort

func (p Uint32Slice) Sort()

Sort is a convenience method.

func (Uint32Slice) Swap

func (p Uint32Slice) Swap(i, j int)

type Uint64Slice

type Uint64Slice []uint64

Uint64Slice attaches the methods of Interface to []uint64, sorting in increasing order.

func (Uint64Slice) Len

func (p Uint64Slice) Len() int

func (Uint64Slice) Less

func (p Uint64Slice) Less(i, j int) bool

func (Uint64Slice) Sort

func (p Uint64Slice) Sort()

Sort is a convenience method.

func (Uint64Slice) Swap

func (p Uint64Slice) Swap(i, j int)

type Uint8Slice

type Uint8Slice []uint8

Uint8Slice attaches the methods of Interface to []uint8, sorting in increasing order.

func (Uint8Slice) Len

func (p Uint8Slice) Len() int

func (Uint8Slice) Less

func (p Uint8Slice) Less(i, j int) bool

func (Uint8Slice) Sort

func (p Uint8Slice) Sort()

Sort is a convenience method.

func (Uint8Slice) Swap

func (p Uint8Slice) Swap(i, j int)

type UintSlice

type UintSlice []uint

UintSlice attaches the methods of Interface to []uint, sorting in increasing order.

func (UintSlice) Len

func (p UintSlice) Len() int

func (UintSlice) Less

func (p UintSlice) Less(i, j int) bool

func (UintSlice) Sort

func (p UintSlice) Sort()

Sort is a convenience method.

func (UintSlice) Swap

func (p UintSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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