최소 힙(Min Heap)을 사용해 우선순위 큐(Priority Queue) 구현class PriorityQueue { constructor() { this.heap = []; } enqueue(value, priority) { this.heap.push({ value, priority }); this.heapUp(); } dequeue() { if (this.size() === 0) return null; if (this.size() === 1) return this.heap.pop(); const min = this.heap[0]; this.heap[0] = this.heap.pop(); this.heapDown(); return min; }..