Documentation ¶
Index ¶
- func InsertAt[E any](s []E, i int, v E) []E
- func OrderedContains[T cmp.Ordered](set []T, elem T) bool
- func OrderedDelete[T cmp.Ordered](set []T, elem T) []T
- func OrderedIndexOf[T cmp.Ordered](set []T, elem T) int
- func OrderedIntersect[T cmp.Ordered](a, b []T) []T
- func OrderedUnion[T cmp.Ordered](a, b []T) []T
- func PutIfAbsent[T cmp.Ordered](set []T, elem T) []T
- func RemoveAt[E any](s []E, i int) []E
- func Shrink[E any](s []E) []E
- func Shuffle[E any](s []E)
- type Float32Slice
- type Float64Slice
- type Int16Slice
- type Int32Slice
- type Int64Slice
- type Int8Slice
- type IntSlice
- type StringSlice
- type Uint16Slice
- type Uint32Slice
- type Uint64Slice
- type Uint8Slice
- type UintSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OrderedContains ¶
OrderedContains `elem`是否在有序数组`set`中
func OrderedDelete ¶
OrderedDelete 把`n`从有序数组中删除
func OrderedIndexOf ¶
OrderedIndexOf `elem`在有序数组`set`中的索引,如果不存在返回-1
func OrderedIntersect ¶
OrderedIntersect 有序数组交集, A ∩ B
Types ¶
type Float32Slice ¶
type Float32Slice []float32
func (Float32Slice) Len ¶
func (x Float32Slice) Len() int
func (Float32Slice) Less ¶
func (x Float32Slice) Less(i, j int) bool
func (Float32Slice) Swap ¶
func (x Float32Slice) Swap(i, j int)
type Float64Slice ¶
type Float64Slice = sort.Float64Slice
type Int16Slice ¶
type Int16Slice []int16
func (Int16Slice) Len ¶
func (x Int16Slice) Len() int
func (Int16Slice) Less ¶
func (x Int16Slice) Less(i, j int) bool
func (Int16Slice) Swap ¶
func (x Int16Slice) Swap(i, j int)
type Int32Slice ¶
type Int32Slice []int32
func (Int32Slice) Len ¶
func (x Int32Slice) Len() int
func (Int32Slice) Less ¶
func (x Int32Slice) Less(i, j int) bool
func (Int32Slice) Swap ¶
func (x Int32Slice) Swap(i, j int)
type Int64Slice ¶
type Int64Slice []int64
func (Int64Slice) Len ¶
func (x Int64Slice) Len() int
func (Int64Slice) Less ¶
func (x Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶
func (x Int64Slice) Swap(i, j int)
type StringSlice ¶
type StringSlice = sort.StringSlice
type Uint16Slice ¶
type Uint16Slice []uint16
func (Uint16Slice) Len ¶
func (x Uint16Slice) Len() int
func (Uint16Slice) Less ¶
func (x Uint16Slice) Less(i, j int) bool
func (Uint16Slice) Swap ¶
func (x Uint16Slice) Swap(i, j int)
type Uint32Slice ¶
type Uint32Slice []uint32
func (Uint32Slice) Len ¶
func (x Uint32Slice) Len() int
func (Uint32Slice) Less ¶
func (x Uint32Slice) Less(i, j int) bool
func (Uint32Slice) Swap ¶
func (x Uint32Slice) Swap(i, j int)
type Uint64Slice ¶
type Uint64Slice []uint64
func (Uint64Slice) Len ¶
func (x Uint64Slice) Len() int
func (Uint64Slice) Less ¶
func (x Uint64Slice) Less(i, j int) bool
func (Uint64Slice) Swap ¶
func (x Uint64Slice) Swap(i, j int)
type Uint8Slice ¶
type Uint8Slice []uint8
func (Uint8Slice) Len ¶
func (x Uint8Slice) Len() int
func (Uint8Slice) Less ¶
func (x Uint8Slice) Less(i, j int) bool
func (Uint8Slice) Swap ¶
func (x Uint8Slice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.