Expand description
Heap operations on slices
Functionsยง
- build
- Make
xsa heap.f(x,y)is whetherxmust be nearer to the root thany. - is_heap
- pop
- Given a slice
xswhich is already a heap, move the root to the end of the slice and retract the heap to exclude it.f(x,y)is whetherxmust be nearer to the root thany.xsbeing empty is an error. - push
- Given a slice
xswhich is all but the last element already a heap, extend the heap to include the last element.f(x,y)is whetherxmust be nearer to the root thany.xsbeing empty is an error. - replace_
root - Given a slice
xswhich is already a heap, replace the root.f(x,y)is whetherxmust be nearer to the root thany.xsbeing empty is an error. - sort
- Given a slice
xswhich is already a heap, sort the elements.