Open Firionus opened 10 months ago
I would like an empty! method for all heap types. It is currently only defined for BinaryMinMaxHeap.
empty!
BinaryMinMaxHeap
Compared to using extract_all!, an empty! method would not allocate a vector, which might be important for performance oriented applications.
extract_all!
Maybe an implementation could look like this:
function Base.empty!(h::AbstractHeap) while !isempty(h) pop!(h) end h end
I would like an
empty!
method for all heap types. It is currently only defined forBinaryMinMaxHeap
.Compared to using
extract_all!
, anempty!
method would not allocate a vector, which might be important for performance oriented applications.Maybe an implementation could look like this: