Exemplo n.º 1
0
        internal void pqdownheap(short[] tree, int k)
        {
            int num = this.heap[k];

            for (int i = k << 1; i <= this.heap_len; i <<= 1)
            {
                if (i < this.heap_len && Deflate.smaller(tree, this.heap[i + 1], this.heap[i], this.depth))
                {
                    i++;
                }
                if (Deflate.smaller(tree, num, this.heap[i], this.depth))
                {
                    break;
                }
                this.heap[k] = this.heap[i];
                k            = i;
            }
            this.heap[k] = num;
        }
Exemplo n.º 2
0
        internal void pqdownheap(short[] tree, int k)
        {
            int num1 = this.heap[k];

            for (int num2 = k << 1; num2 <= this.heap_len; num2 = num2 << 1)
            {
                if ((num2 < this.heap_len) && Deflate.smaller(tree, this.heap[num2 + 1], this.heap[num2], this.depth))
                {
                    num2++;
                }
                if (Deflate.smaller(tree, num1, this.heap[num2], this.depth))
                {
                    break;
                }
                this.heap[k] = this.heap[num2];
                k            = num2;
            }
            this.heap[k] = num1;
        }