Lines Matching refs:heap
4024 this.heap = []; property
4029 return this.heap.length;
4033 this.heap = []; property
4040 while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) {
4041 let t = this.heap[index];
4042 this.heap[index] = this.heap[p];
4043 this.heap[p] = t;
4052 while ((l=leftChi(index)) < this.heap.length) {
4053 if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) {
4057 if (smaller(this.heap[index], this.heap[l])) {
4061 let t = this.heap[index];
4062 this.heap[index] = this.heap[l];
4063 this.heap[l] = t;
4071 this.heap.push(node);
4072 this.percUp(this.heap.length-1);
4076 return this.heap.push(node);
4080 let [top] = this.heap;
4082 this.heap[0] = this.heap[this.heap.length-1];
4083 this.heap.pop();
4094 for (let i = 0; i < this.heap.length; i++) {
4095 yield this.heap[i].data;
4101 for (let i = 0; i < this.heap.length; i++) {
4102 if (!testFn(this.heap[i])) {
4103 this.heap[j] = this.heap[i];
4108 this.heap.splice(j);
4110 for (let i = parent(this.heap.length-1); i >= 0; i--) {