Next: , Previous: , Up: binary heaps   [Index]


39.3 Heap accessors and mutators

The following bindings are exported by the library (vicare containers binary-heaps). The bindings whose name is prefixed with $ are unsafe operations: they do not validate their arguments before accessing them.

Function: binary-heap-top heap
Function: $binary-heap-top heap

Return the object at the root of the heap. Raise an assertion violation if heap is empty.

Function: binary-heap-push! heap obj
Function: $binary-heap-push! heap obj

Push obj on the heap.

Function: binary-heap-pop! heap
Function: $binary-heap-pop! heap

Remove the object at the root of the heap and return it. Raise an assertion violation if heap is empty.

Function: binary-heap-fill! heap item*
Function: $binary-heap-fill! heap item*

Push on the heap the list of objects item*.

Function: binary-heap-purge! heap
Function: $binary-heap-purge! heap

Remove all the elements from heap.