// pqRemove removes and returns the element at index i from the heap.
// The complexity is O(log n) where n = h.Len().
pqRemove removes and returns the element at index i from the heap.
The complexity is O(log n) where n = h.Len().
// pqRemove removes and returns the element at index i from the heap . // The complexity is O ( log n ) where n = h . Len () .
func pqRemove(h *priorityQueue, i int) *node {
	n := h.Len() - 1
	if n != i {
		h.Swap(i, n)
		if !down(h, i, n) {
			up(h, i)
		}
	}
	return h.Pop()
}
func pqRemove ( h * priorityQueue , i int ) * node { n := h . Len ( ) - 1 if n != i { h . Swap ( i , n ) if ! down ( h , i , n ) { up ( h , i ) } } return h . Pop ( ) }
pqRemove removes and returns the element at index i from the heap.
pqRemove removes and returns the element at index i from the heap .