JavaScript

스왑

GREEN나무 2025. 1. 10. 09:29
728x90
 // 부모와 현재 노드의 값을 교환
      [this.heap[parentIndex], this.heap[index]] = [this.heap[index], this.heap[parentIndex]];