Details
struct GtsHeap
An opaque data structure describing a binary heap.
gts_heap_new ()
GtsHeap* gts_heap_new (GCompareFunc compare_func); |
gts_heap_insert ()
void gts_heap_insert (GtsHeap *heap,
gpointer p); |
Inserts a new element p in the heap.
gts_heap_remove_top ()
gpointer gts_heap_remove_top (GtsHeap *heap); |
Removes the element at the top of the heap.
gts_heap_top ()
gpointer gts_heap_top (GtsHeap *heap); |
gts_heap_freeze ()
void gts_heap_freeze (GtsHeap *heap); |
Freezes the heap. Any subsequent operation will not preserve the heap
property. Used in conjunction with gts_heap_insert() and gts_heap_thaw()
to create a heap in O(n) time.
gts_heap_thaw ()
void gts_heap_thaw (GtsHeap *heap); |
If heap has been frozen previously using gts_heap_freeze(), reorder it
in O(n) time and unfreeze it.
gts_heap_foreach ()
void gts_heap_foreach (GtsHeap *heap,
GFunc func,
gpointer user_data); |
gts_heap_size ()
guint gts_heap_size (GtsHeap *heap); |
gts_heap_destroy ()
void gts_heap_destroy (GtsHeap *heap); |
Free all the memory allocated for heap.