compare

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IntMap   = IntLess
	Int8Map  = Int8Less
	Int16Map = Int16Less
	Int32Map = Int32Less
	Int64Map = Int64Less

	UintMap   = UintLess
	Uint8Map  = Uint8Less
	Uint16Map = Uint16Less
	Uint32Map = Uint32Less
	Uint64Map = Uint64Less

	Float32Map = Float32Less
	Float64Map = Float64Less

	StringMap = StringLess
)
View Source
var (
	IntPriorityQueue   = IntMore
	Int8PriorityQueue  = Int8More
	Int16PriorityQueue = Int16More
	Int32PriorityQueue = Int32More
	Int64PriorityQueue = Int64More

	UintPriorityQueue   = UintMore
	Uint8PriorityQueue  = Uint8More
	Uint16PriorityQueue = Uint16More
	Uint32PriorityQueue = Uint32More
	Uint64PriorityQueue = Uint64More

	Float32PriorityQueue = Float32More
	Float64PriorityQueue = Float64More

	StringPriorityQueue = StringMore
)

默认从大到小

View Source
var (
	IntRbTree   = IntLess
	Int8RbTree  = Int8Less
	Int16RbTree = Int16Less
	Int32RbTree = Int32Less
	Int64RbTree = Int64Less

	UintRbTree   = UintLess
	Uint8RbTree  = Uint8Less
	Uint16RbTree = Uint16Less
	Uint32RbTree = Uint32Less
	Uint64RbTree = Uint64Less

	Float32RbTree = Float32Less
	Float64RbTree = Float64Less

	StringRbTree = StringLess
)
View Source
var (
	IntSkipList   = IntMore
	Int8SkipList  = Int8More
	Int16SkipList = Int16More
	Int32SkipList = Int32More
	Int64SkipList = Int64More

	UintSkipList   = UintMore
	Uint8SkipList  = Uint8More
	Uint16SkipList = Uint16More
	Uint32SkipList = Uint32More
	Uint64SkipList = Uint64More

	Float32SkipList = Float32More
	Float64SkipList = Float64More

	StringSkipList = StringMore
)
View Source
var Float32Less = func(a, b float32) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Float32More = func(a, b float32) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Float64Less = func(a, b float64) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Float64More = func(a, b float64) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int16Less = func(a, b int16) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int16More = func(a, b int16) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int32Less = func(a, b int32) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int32More = func(a, b int32) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int64Less = func(a, b int64) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int64More = func(a, b int64) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int8Less = func(a, b int8) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Int8More = func(a, b int8) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var IntLess = func(a, b int) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var IntMore = func(a, b int) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var StringLess = func(a, b string) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var StringMore = func(a, b string) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint16Less = func(a, b uint16) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint16More = func(a, b uint16) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint32Less = func(a, b uint32) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint32More = func(a, b uint32) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint64Less = func(a, b uint64) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint64More = func(a, b uint64) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint8Less = func(a, b uint8) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var Uint8More = func(a, b uint8) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}
View Source
var UintLess = func(a, b uint) int {
	if a < b {
		return 1
	} else if a > b {
		return -1
	} else {
		return 0
	}
}
View Source
var UintMore = func(a, b uint) int {
	if a > b {
		return 1
	} else if a < b {
		return -1
	} else {
		return 0
	}
}

Functions

This section is empty.

Types

type CmpFunc

type CmpFunc[T any] func(a, b T) int

type MapFunc

type MapFunc[T any] CmpFunc[T]

MapFunc 自义定比对参数,需注意格式应与 IntMore 一致

type PriorityQueueFunc

type PriorityQueueFunc[T any] CmpFunc[T]

PriorityQueueFunc 自义定比对参数,需注意格式应与 IntMore 一致

type RbTreeFunc

type RbTreeFunc[T any] CmpFunc[T]

RbTreeFunc 自义定比对参数,需注意格式应与 IntMore 一致

type SkipListFunc

type SkipListFunc[T any] CmpFunc[T]

SkipListFunc 自义定比对参数,需注意格式应与 IntMore 一致

Jump to

Keyboard shortcuts

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