![]() |
![]() |
Returns 1 for success, 0 otherwise
![]() |
Returns the smallest element in the heap, if it exists
![]() |
Insert <key, elem> into heap h
![]() |
![]() |
![]() |
![]() |
Returns the smallest element in the heap, if it exists, NULL otherwise
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Returns 1 for success, 0 otherwise
for (elem = heap_iter_init(h); elem; elem = heap_iter(h))
Do whatever to the elem. You cannot use heap_iter to do anything but inspect the heap. If
heap_insert(), heap_extract_min(), or heap_delete() are called
while iterating through the heap, all bets are off. Tue Nov 14 20:17:59 PST 1995 -- kva
Actually now, heap_create() initialises h_iter correctly,
and heap_iter() correctly resets h_iter
when the heap is traversed, So, we do not really need
heap_iter_init() anymore, except to break off a current
iteration and restart.
Insert <key, elem> into heap h.
Adjust heap_size if we hit the limit.
Returns the smallest element in the heap, if it exists,
NULL otherwise. The element is still in the heap.
Returns the smallest element in the heap, if it exists.
NULL otherwise.
unsigned int h_size
unsigned int h_maxsize
unsigned int h_iter
unsigned int parent(unsigned int i)
unsigned int left(unsigned int i)
unsigned int right(unsigned int i)
void swap(unsigned int i, unsigned int j)
unsigned int KEY_LESS_THAN(heap_key_t k1, heap_secondary_key_t ks1, heap_key_t k2, heap_secondary_key_t ks2)
unsigned int KEY_LESS_OR_EQUAL_THAN(heap_key_t k1, heap_key_t k2)
Heap(int size=HEAP_DEFAULT_SIZE)
~Heap()
int heap_member(void* elem)
int heap_delete(void* elem)
void* heap_iter_init()
void* heap_iter()
void heap_insert(heap_key_t key, void* elem)
void* heap_min()
void* heap_extract_min()
this page has been generated automatically by doc++
Adapted for the NS documentation page
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de