code: function pqdownheap(tree, k) {
  		var v = heap[k],
  			j = k << 1; // left son of k
  
  		while (j <= heap_len) {
  			// Set j to the smallest of the two sons:
  			if (j < heap_len && SMALLER(tree, heap[j + 1], heap[j])) {
  				j++;
  			}
  
  			// Exit if v is smaller than both sons
  			if (SMALLER(tree, v, heap[j])) {
  				break;
  			}
  
  			// Exchange v with the smallest son
  			heap[k] = heap[j];
  			k = j;
  
  			// And continue down the tree, setting j to the left son of k
  			j <<= 1;
  		}
  		heap[k] = v;
  	}
docs: /* ==========================================================================
  Restore the heap property by moving down the tree starting at node k,
  exchanging a node with the smallest of its two sons if necessary, stopping
  when the heap property is re-established (each father smaller than its
  two sons).
  
  @param tree- tree to restore
  @param k- node to move down