Documentation ¶
Overview ¶
Package heap provides heap operations for any type that implements heap.Interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(h Interface)
A heap must be initialized before any of the heap operations can be used. Init is idempotent with respect to the heap invariants and may be called whenever the heap invariants may have been invalidated. Its complexity is O(n) where n = h.Len().
func Pop ¶
func Pop(h Interface) interface{}
Pop removes the minimum element (according to Less) from the heap and returns it. The complexity is O(log(n)) where n = h.Len(). Same as Remove(h, 0).
Types ¶
Click to show internal directories.
Click to hide internal directories.