Answer:CREATE_HEAP(K,N)
[K is the array and N is the total number of elements in the array]
1. [Build Heap]
Repeat thru step 7 for
Q <-- 2,3,….N.
2. [Initialize construction phase]
I <-- Q
KEY <-- K[Q]
3. [Obtain parent of new record]
J <-- I/2
4. [Place new record in existing heap]
Repeat thru step 6 while I > 1 & KEY > K[J]
5. [Interchange record]
K[I] <-- K[J]
6. [Obtain next parent]
I <-- J
J <-- I/2
7. [Copy new record into its proper place]
K[I] <-- KEY
8. [FINISH]
return.