Crate heapp

Source
Expand description

Some heap operations on slice.

Functionsยง

heap_pop
Move the smallest element to the tail of the heap.
heap_pop_by
Just like heap_pop, but with a compare function.
heap_push
Gives a heap slice, which contains a new element in the tail, using heap_push function to extend the heap to include the tail element. Default heap is smallest heap.
heap_push_by
Just like heap_push, but with a compare function to indicate the order of the heap.
heap_sort
Using heap sort algorithm
heapify
To construct a heap from a slice; default heap is smallest heap.
n_smallest
Get the n smallest element from a slice, when n > len, return None.