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