cr8r_pheap_node * cr8r_pheap_new(void *key, cr8r_pheap_ft *, cr8r_pheap_node *first_child, cr8r_pheap_node *sibling, cr8r_pheap_node *parent)
Allocate a new pairing heap node using ft->alloc and initialize it.
void cr8r_pheap_delete(cr8r_pheap_node *, cr8r_pheap_ft *)
Delete all nodes in a pairing heap.
cr8r_pheap_node * cr8r_pheap_pop(cr8r_pheap_node **r, cr8r_pheap_ft *)
Remove the root (minimal) element from a pairing heap.
void * cr8r_pheap_top(cr8r_pheap_node *, cr8r_pheap_ft *)
Return a pointer to the minimal data element of a pairing heap, or NULL if the heap is empty.
cr8r_pheap_node * cr8r_pheap_root(cr8r_pheap_node *)
Return a pointer to the root node given a pointer to any node in a heap.
cr8r_pheap_node * cr8r_pheap_decreased_key(cr8r_pheap_node *n, cr8r_pheap_ft *)
Restore the (min) heap invariant after decreasing the key of a node.
cr8r_pheap_node * cr8r_pheap_meld(cr8r_pheap_node *a, cr8r_pheap_node *b, cr8r_pheap_ft *)
Combine two pairing heaps, invalidating them The nodes of the existing heaps are reused and re-linked...
cr8r_pheap_node * cr8r_pheap_push(cr8r_pheap_node *, void *key, cr8r_pheap_ft *)
Insert an item into a pairing heap Allocates and initializes a new node for the new item.
Base function table for all Crater containers.
function table for pairing heaps note that since this is an intrusive data structure,...
cr8r_base_ft base
Base function table values (data and size)
cr8r_pheap_node * parent
pointer to the parent
cr8r_pheap_node * first_child
pointer to the first child (or NULL). All children form a circularly linked list
cr8r_pheap_node * sibling
pointer to the next sibling. These are the pointers that form a cll.