BuildHeap(A) 1 HeapSize(A) = length(A) 2 for i = length(A)/2 downto 1 3 Heapify(A,i)
A[( n/2 + 1) ... n] are leaves and heaps.
Click on mouse to advance to next frame.