Algorithm 1 Heap-DeleteMin(A) min ← A[0] Swap(A[0], A[heap-size[A]-1]) heap-size[A] ← heap-size[A] - 1 Min-Heapify(A, 0) return min Algorithm 2 Min-Heapify(A, i) l ← Left-child-index(i) r ← Right-child-index(i) if l < heap-size[A] and A[l] < A[i] then smallest ← l else smallest ← i end if if r < heap-size[A] and A[r] < A[smallest] then smallest ← r end if if smallest ≠ i then Swap(A[i], A[smallest]) Min-Heapify(A, smallest) end if