#include <stdio.h>#include <stdlib.h>#include <malloc.h>#include "l_alloc_new.h"#include "heap.h"Go to the source code of this file.
Defines | |
| #define | Heap_NodeSwap(a, b) |
Functions | |
| void | HeapifyMax (Heap *root) |
| void | HeapifyMin (Heap *root) |
| Heap * | Heap_Create (int dir) |
| Heap * | Heap_Dispose (Heap *root, void(*element_dispose)(void *)) |
| void | Heap_Insert (Heap *root, void *element, double weight) |
| void * | Heap_Top (Heap *root) |
| double * | Heap_TopWeight (Heap *root) |
| void * | Heap_ExtractTop (Heap *root) |
Variables | |
| char | copyright [] |
| L_Alloc_Pool * | heapNodePool = NULL |
|
|
Value: { HeapNode node; \
node.weight = (a)->weight; \
node.element = (a)->element; \
(a)->weight = (b)->weight; \
(a)->element = (b)->element; \
(b)->weight = node.weight; \
(b)->element = node.element; \
}
Definition at line 47 of file heap.c. Referenced by Heap_Insert(), HeapifyMax(), and HeapifyMin(). |
|
|
Definition at line 120 of file heap.c. References Heap::dir, Heap::heap, heapNodePool, L_create_alloc_pool(), malloc(), and Heap::size. |
|
||||||||||||
|
Definition at line 140 of file heap.c. References h_node::element, free(), Heap::heap, heapNodePool, L_free(), h_node::left, h_node::p, and h_node::right. |
|
|
Definition at line 252 of file heap.c. References Heap::dir, h_node::element, Heap::heap, HEAP_MAX, HeapifyMax(), HeapifyMin(), heapNodePool, L_free(), h_node::left, h_node::p, h_node::right, Heap::size, size, and h_node::weight. |
|
||||||||||||||||
|
Definition at line 173 of file heap.c. References Heap::dir, h_node::element, Heap::heap, HEAP_MAX, Heap_NodeSwap, heapNodePool, L_alloc(), h_node::left, h_node::p, h_node::right, Heap::size, size, and h_node::weight. |
|
|
Definition at line 230 of file heap.c. References h_node::element, Heap::heap, and Heap::size. |
|
|
Definition at line 241 of file heap.c. References Heap::heap, Heap::size, and h_node::weight. |
|
|
Definition at line 57 of file heap.c. References Heap::heap, Heap_NodeSwap, h_node::left, h_node::right, and h_node::weight. Referenced by Heap_ExtractTop(). |
|
|
Definition at line 87 of file heap.c. References Heap::heap, Heap_NodeSwap, h_node::left, h_node::right, and h_node::weight. Referenced by Heap_ExtractTop(). |
|
|
Initial value: "Copyright (c) 1991 Richard Hank, Wen-mei Hwu and The Board of \n\ Trustees of the University of Illinois. All rights reserved.\n" |
|
|
Definition at line 27 of file heap.c. Referenced by Heap_Create(), Heap_Dispose(), Heap_ExtractTop(), and Heap_Insert(). |
1.3.2