package
Version:
v0.0.21
Opens a new window with list of versions in this module.
Published: Jul 25, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
func AdjustDown[T any](heap []T, i int, less cmp.LessFunc[T])
-
func AdjustUp[T any](heap []T, i int, less cmp.LessFunc[T])
-
func Down[T any](heap []T, i0, n int, less cmp.LessFunc[T]) bool
-
func Fix[T any](heap []T, i int, less cmp.LessFunc[T])
-
func HeapInit[T any](heap []T, less cmp.LessFunc[T])
-
func Up[T any](heap []T, j int, less cmp.LessFunc[T])
-
type Heap
type Heap[T any] struct {
}
func (h *Heap[T]) Push(x T)
当达到堆预设大小时会增加堆的大小
func (h *Heap[T]) Put(val T)
不会改变预设堆的大小
Source Files
¶
Click to show internal directories.
Click to hide internal directories.