|
enum cdc_stat | cdc_heap_ctor (struct cdc_heap **h, struct cdc_data_info *info) |
| Constructs an empty heap. More...
|
|
enum cdc_stat | cdc_heap_ctorl (struct cdc_heap **h, struct cdc_data_info *info,...) |
| Constructs a heap, initialized by an arbitrary number of pointers. The last item must be NULL. More...
|
|
enum cdc_stat | cdc_heap_ctorv (struct cdc_heap **h, struct cdc_data_info *info, va_list args) |
| Constructs a heap, initialized by args. The last item must be NULL. More...
|
|
void | cdc_heap_dtor (struct cdc_heap *h) |
| Destroys the heap. More...
|
|
static void * | cdc_heap_top (struct cdc_heap *h) |
| Returns a pointer to the heap's top item. This function assumes that the heap isn't empty. More...
|
|
static size_t | cdc_heap_size (struct cdc_heap *h) |
| Returns the number of items in the heap. More...
|
|
static bool | cdc_heap_empty (struct cdc_heap *h) |
| Returns true if the heap has size 0; otherwise returns false. More...
|
|
void | cdc_heap_extract_top (struct cdc_heap *h) |
| Extracts the top item from the heap. This function assumes that the heap isn't empty. More...
|
|
enum cdc_stat | cdc_heap_riinsert (struct cdc_heap *h, void *key, struct cdc_heap_iter *ret) |
| Inserts element key to the heap. Write an iterator pointing to a new element in the ret. More...
|
|
static enum cdc_stat | cdc_heap_insert (struct cdc_heap *h, void *key) |
| Inserts element key to the heap. More...
|
|
void | cdc_heap_change_key (struct cdc_heap *h, struct cdc_heap_iter *pos, void *key) |
| Changes the item key on the pos position in the heap. More...
|
|
void | cdc_heap_clear (struct cdc_heap *h) |
| Removes all the elements from the heap. More...
|
|
void | cdc_heap_swap (struct cdc_heap *a, struct cdc_heap *b) |
| Swaps heaps a and b. This operation is very fast and never fails. More...
|
|
enum cdc_stat | cdc_heap_merge (struct cdc_heap *h, struct cdc_heap *other) |
| Merges two heaps. In the heap h will be the result of the merger, and the heap other will remain empty. More...
|
|
bool | cdc_heap_is_heap (struct cdc_heap *h) |
| Checks the heap property. More...
|
|
static void * | cdc_heap_iter_data (struct cdc_heap_iter *it) |
| Returns a pointer to the key of current item. More...
|
|
static bool | cdc_heap_iter_is_eq (struct cdc_heap_iter *it1, struct cdc_heap_iter *it2) |
| Returns false if the iterator it1 equal to the iterator it2, otherwise returns false. More...
|
|
The cdc_heap is a struct and functions that provide a binary heap.
- Author
- Maksim Andrianov maksi.nosp@m.mand.nosp@m.riano.nosp@m.v1@y.nosp@m.andex.nosp@m..ru