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