// pqInit establishes the heap invariants required by the other routines in this file.
// Init is idempotent with respect to the heap invariants
// and may be called whenever the heap invariants may have been invalidated.
// The complexity is O(n) where n = h.Len().
pqInit establishes the heap invariants required by the other routines in this file.
Init is idempotent with respect to the heap invariants
and may be called whenever the heap invariants may have been invalidated.
The complexity is O(n) where n = h.Len().
// pqInit establishes the heap invariants required by the other routines in this file . // Init is idempotent with respect to the heap invariants // and may be called whenever the heap invariants may have been invalidated . // The complexity is O ( n ) where n = h . Len () .
func pqInit(h *priorityQueue) {
	n := h.Len()
	for i := n/2 - 1; i >= 0; i-- {
		down(h, i, n)
	}
}
func pqInit ( h * priorityQueue ) { n := h . Len ( ) for i := n / 2 - 1 ; i >= 0 ; i -- { down ( h , i , n ) } }
pqInit establishes the heap invariants required by the other routines in this file.
pqInit establishes the heap invariants required by the other routines in this file .
// heapify