/* insert element to the heap */ heap_node *heap_insert(heap *h,int value) { heap_node * hn = heap_node_new(value); h->insertion_buffer[(h->insertion_buffer_size)++] = hn; if (h->minimum==NULL || value < h->minimum->value) { h->minimum = hn; } h->n_elements++; return hn; }
/* insert element to the heap */ heap_node * heap_insert(heap *h,int value) { heap_node *node = heap_node_new(value); h->root = heap_node_meld(h->root,node); return node; }
/* insert element to the heap */ heap_node * heap_insert(foi weight) { heap_node *node = heap_node_new(weight); hp->root = heap_node_meld(hp->root,node); return node; }