Jump to content

Priority queue: Difference between revisions

Line 253:
if (h->len + 1 >= h->size) {
h->size = h->size ? h->size * 2 : 4;
h->nodes = (node_t *)realloc(h->nodes, h->size * sizeof (node_t));
}
int i = h->len + 1;
Line 296:
 
int main () {
heap_t *h = (heap_t *)calloc(1, sizeof (heap_t));
push(h, 3, "Clear drains");
push(h, 4, "Feed cat");
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.