Documentation ¶
Index ¶
- func AdjustDown[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i int)
- func AdjustUp[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i int)
- func Down[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i0, n int) bool
- func Fix[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i int)
- func Init[T cmp.CompareKey[V], V constraints.Ordered](heap []T)
- func Up[T cmp.CompareKey[V], V constraints.Ordered](heap []T, j int)
- type Heap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustDown ¶
func AdjustDown[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i int)
与Down一致,不同的写法
func AdjustUp ¶
func AdjustUp[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i int)
与Up一致,不同的写法
func Down ¶
func Down[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i0, n int) bool
func Fix ¶
func Fix[T cmp.CompareKey[V], V constraints.Ordered](heap []T, i int)
func Init ¶
func Init[T cmp.CompareKey[V], V constraints.Ordered](heap []T)
func Up ¶
func Up[T cmp.CompareKey[V], V constraints.Ordered](heap []T, j int)
Types ¶
type Heap ¶
type Heap[T cmp.CompareKey[V], V constraints.Ordered] []T
func New ¶
func New[T cmp.CompareKey[V], V constraints.Ordered](l int) Heap[T, V]
func NewFromArray ¶
func NewFromArray[T cmp.CompareKey[V], V constraints.Ordered](arr []T) Heap[T, V]
Click to show internal directories.
Click to hide internal directories.