33 if (max_heap->
id >= max_heap_size)
41 max_heap[
i] = max_heap[i / 2];
55 for (i = 1; i <= max_heap[0].
id; i++)
57 if (max_heap[i].
id ==
id)
70 max_heap[k] = max_heap[k / 2];
83 if (max_heap[0].
id <= 0)
88 temp = max_heap[(max_heap[0].
id)--];
92 while (child <= max_heap[0].
id)
94 if ((child < max_heap[0].
id) && (max_heap[child].
priority < max_heap[child + 1].
priority))
98 max_heap[parent] = max_heap[child];
102 max_heap[parent] = temp;
111 for (i = 1; i <= max_heap[0].
id; i++)
int max_heap_delete(T_MAX_HEAP_NODE *max_heap, T_MAX_HEAP_NODE *ret)
int max_heap_change_priority(T_MAX_HEAP_NODE *max_heap, int id, int new_priority)
void max_heap_incr_priority(T_MAX_HEAP_NODE *max_heap)
int max_heap_insert(T_MAX_HEAP_NODE *max_heap, int max_heap_size, T_MAX_HEAP_NODE *item)