(int x)
| 71 | public static int size; |
| 72 | |
| 73 | public static void add(int x) { |
| 74 | heap[size] = x; |
| 75 | int i = size++; |
| 76 | while (heap[i] < heap[(i - 1) / 2]) { |
| 77 | swap(i, (i - 1) / 2); |
| 78 | i = (i - 1) / 2; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | public static void pop() { |
| 83 | swap(0, --size); |
no test coverage detected