void restoreheapup(int *,int)void restoreheapdown(int*,int,int)int main(int heap[max], , ,jclrscr()printf("\ enter the number of elements ")scanf("% ",& )printf("\ enter the elements ")for( = ; <= ; ++scanf("% ",&heap[ ])restoreheapup(heapi)/heapify /delete the root element and heapify the heap =nfor( = ; <= ; ++int temptemp=heap[ ]heap[ ]heap[ ]heap[ ]=tempn - /the element heap[nis supposed to be deleted restoreheapdown(heap, , )/heapify =jprintf("\ the sorted elements are")for( = ; <= ; ++printf("% ",heap[ ])return void restoreheapup(int *heap,int indexint val heap[index]while(index> &(heap[index/ val/check parent' value heap[index]=heap[index/ ]index / heap[index]=valvoid restoreheapdown(int *heap,int index,int nint val heap[index]int =index* while( <=nif( < &(heap[jheap[ + ]))/check sibling' value ++if(heap[jheap[ / ]/check parent' value breakheap[ / ]=heap[ ] = * heap[ / ]val