用时:10min 一道简单题应该不会让我手写最大堆吧 const swap = function (arr,i,j) { [arr[i],arr[j]] = [arr[j],arr[i]] } class MaxHeap { constructor() { this.count = 0 this.data = new Array(this.count + 1) } shiftUp(k) { // …
Algorithms
Created
Sun, 21 Mar 2021 00:00:00 +1300