4 * <<intro,Introduction>>
17 // Create an empty heap
19 #define MY_CMP(x, y) ((x) < (y))
23 HEAP_INSERT(int, heap, n, MY_CMP, HEAP_SWAP);
25 HEAP_INSERT(int, heap, n, MY_CMP, HEAP_SWAP);
27 HEAP_INSERT(int, heap, n, MY_CMP, HEAP_SWAP);
29 // Remove the minimum (10)
30 HEAP_DELMIN(int, heap, n, MY_CMP, HEAP_SWAP);
32 // Print the new minimum (20)
33 printf("%d", heap[1]);
35 // Increase the minimum by 20 to 40
37 HEAP_INCREASE(int, heap, n, MY_CMP, HEAP_SWAP, 1);
39 // Print the new minimum (30)
40 printf("%d", heap[1]);