Documentation ¶
Index ¶
- func HeapSort(data sort.Interface)
- func InsertionSort(data sort.Interface)
- type Comparable
- type Float32Slice
- type Float64Slice
- type IDSet
- type Int16Slice
- type Int32Slice
- type Int64Slice
- type Int8Slice
- type IntSlice
- type OrderedIDSet
- type StringSlice
- type Uint16Slice
- type Uint32Slice
- type Uint64Slice
- type Uint8Slice
- type UintSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Comparable ¶
type Comparable interface { // a.CompareTo(b) < 0 表明a < b // a.CompareTo(b) > 0 表明a > b // a.CompareTo(b) == 0 表明a == b CompareTo(Comparable) int }
模仿java的丐版java.lang.Comparable
内部实现要符合结合律: (a.compareTo(b) > 0 && b.compareTo(c) > 0) implies a.compareTo(c) > 0
type Float32Slice ¶ added in v0.1.21
type Float32Slice []float32
func (Float32Slice) Len ¶ added in v0.1.21
func (x Float32Slice) Len() int
func (Float32Slice) Less ¶ added in v0.1.21
func (x Float32Slice) Less(i, j int) bool
func (Float32Slice) Swap ¶ added in v0.1.21
func (x Float32Slice) Swap(i, j int)
type Float64Slice ¶ added in v0.1.21
type Float64Slice []float64
func (Float64Slice) Len ¶ added in v0.1.21
func (x Float64Slice) Len() int
func (Float64Slice) Less ¶ added in v0.1.21
func (x Float64Slice) Less(i, j int) bool
func (Float64Slice) Swap ¶ added in v0.1.21
func (x Float64Slice) Swap(i, j int)
type Int16Slice ¶ added in v0.1.21
type Int16Slice []uint16
func (Int16Slice) Len ¶ added in v0.1.21
func (x Int16Slice) Len() int
func (Int16Slice) Less ¶ added in v0.1.21
func (x Int16Slice) Less(i, j int) bool
func (Int16Slice) Swap ¶ added in v0.1.21
func (x Int16Slice) Swap(i, j int)
type Int32Slice ¶ added in v0.1.21
type Int32Slice []int32
func (Int32Slice) Len ¶ added in v0.1.21
func (x Int32Slice) Len() int
func (Int32Slice) Less ¶ added in v0.1.21
func (x Int32Slice) Less(i, j int) bool
func (Int32Slice) Swap ¶ added in v0.1.21
func (x Int32Slice) Swap(i, j int)
type Int64Slice ¶ added in v0.1.21
type Int64Slice []int64
func (Int64Slice) Len ¶ added in v0.1.21
func (x Int64Slice) Len() int
func (Int64Slice) Less ¶ added in v0.1.21
func (x Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶ added in v0.1.21
func (x Int64Slice) Swap(i, j int)
type OrderedIDSet ¶
type OrderedIDSet []int32
用数组实现的有序数字集合,仅用于存储少量数据且查询多过插入/删除的场合
func (OrderedIDSet) Has ¶
func (s OrderedIDSet) Has(id int32) bool
type StringSlice ¶ added in v0.1.21
type StringSlice []string
func (StringSlice) Len ¶ added in v0.1.21
func (x StringSlice) Len() int
func (StringSlice) Less ¶ added in v0.1.21
func (x StringSlice) Less(i, j int) bool
func (StringSlice) Swap ¶ added in v0.1.21
func (x StringSlice) Swap(i, j int)
type Uint16Slice ¶ added in v0.1.21
type Uint16Slice []uint16
func (Uint16Slice) Len ¶ added in v0.1.21
func (x Uint16Slice) Len() int
func (Uint16Slice) Less ¶ added in v0.1.21
func (x Uint16Slice) Less(i, j int) bool
func (Uint16Slice) Swap ¶ added in v0.1.21
func (x Uint16Slice) Swap(i, j int)
type Uint32Slice ¶ added in v0.1.21
type Uint32Slice []uint32
func (Uint32Slice) Len ¶ added in v0.1.21
func (x Uint32Slice) Len() int
func (Uint32Slice) Less ¶ added in v0.1.21
func (x Uint32Slice) Less(i, j int) bool
func (Uint32Slice) Swap ¶ added in v0.1.21
func (x Uint32Slice) Swap(i, j int)
type Uint64Slice ¶ added in v0.1.21
type Uint64Slice []uint64
func (Uint64Slice) Len ¶ added in v0.1.21
func (x Uint64Slice) Len() int
func (Uint64Slice) Less ¶ added in v0.1.21
func (x Uint64Slice) Less(i, j int) bool
func (Uint64Slice) Swap ¶ added in v0.1.21
func (x Uint64Slice) Swap(i, j int)
type Uint8Slice ¶ added in v0.1.21
type Uint8Slice []uint8
func (Uint8Slice) Len ¶ added in v0.1.21
func (x Uint8Slice) Len() int
func (Uint8Slice) Less ¶ added in v0.1.21
func (x Uint8Slice) Less(i, j int) bool
func (Uint8Slice) Swap ¶ added in v0.1.21
func (x Uint8Slice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.