힙(Heap)구현 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 void push(int n) {//1이 root heap[++hcou] = n; int child = hcou; int parent = child / 2; while (child > 1 && heap[child] > heap[parent]) { swap(heap[child], heap[parent]); child = parent; parent /= 2; } } int pop() {//1값 반환 int res = heap[1]; swap(heap[1], heap[hcou]); hcou--; int parent = 1; int child = pa..