The Interface type describes the requirements for a type using the routines in this package. Any type that implements it may be used as a min-heap with the following invariants (established after Init has been called or if the data is empty or sorted):

!h.Less(j, i) for 0 <= i < h.Len() and 2*i+1 <= j <= 2*i+2 and j < h.Len()

Note that Push and Pop in this interface are for package heap's implementation to call. To add and remove things from the heap, use heap.Push and heap.Pop.

See also:

Fields

dynamicswap(_0:GoInt, _1:GoInt):Void

@:interfacetypeffundynamicpush(_x:AnyInterface):Void

add x as element Len()

@:interfacetypeffundynamicpop():AnyInterface

remove and return element Len() - 1.

dynamicless(_0:GoInt, _1:GoInt):Bool

dynamiclen():GoInt

__underlying__():AnyInterface

Allows struct or interfaces to provide back type information.

Returns:

go.AnyInterface