Lines Matching refs:heap
10 this.heap = []; property
15 return this.heap.length;
19 this.heap = []; property
26 while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) {
27 let t = this.heap[index];
28 this.heap[index] = this.heap[p];
29 this.heap[p] = t;
38 while ((l = leftChi(index)) < this.heap.length) {
39 if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) {
43 if (smaller(this.heap[index], this.heap[l])) {
47 let t = this.heap[index];
48 this.heap[index] = this.heap[l];
49 this.heap[l] = t;
57 this.heap.push(node);
58 this.percUp(this.heap.length - 1);
62 return this.heap.push(node);
66 let [top] = this.heap;
68 this.heap[0] = this.heap[this.heap.length - 1];
69 this.heap.pop();
80 for (let i = 0; i < this.heap.length; i++) {
81 yield this.heap[i].data;
87 for (let i = 0; i < this.heap.length; i++) {
88 if (!testFn(this.heap[i])) {
89 this.heap[j] = this.heap[i];
94 this.heap.splice(j);
96 for (let i = parent(this.heap.length - 1); i >= 0; i--) {