최소 힙(Min Heap) 구현class MinHeap { constructor() { this.heap = []; } insert(v) { this.heap.push(v); this.heapUp(); } remove() { if (this.size() === 1) return this.heap.pop(); if (this.size() === 0) return null; const v = this.heap[0]; this.heap[0] = this.heap.pop(); this.heapDown(); return v; } heapUp() { let child = this.size() - 1; while (child > 0) { ..