Language: C

#include <stdio.h>
struct Heap{
	int value;
}MaxHeap[500000];
int heapCount=0;

void insert(int value){
	if(heapCount==500000){
		printf("Heap Penuh");
		return;
	}
	heapCount++;
	MaxHeap[heapCount].value=value;
	
	int currJmlhData=heapCount;
	while(currJmlhData!=1 && MaxHeap[currJmlhData/2].value<MaxHeap[currJmlhData].value){
		Heap temp=MaxHeap[currJmlhData];
		MaxHeap[currJmlhData]=MaxHeap[currJmlhData/2];
		MaxHeap[currJmlhData/2]=temp;

		currJmlhData/=2;
	}
}

void heapDown(int parentIdx){
	Heap currValue=MaxHeap[parentIdx];
	int currIdx=parentIdx;
	if((parentIdx*2)<=heapCount && currValue.value<MaxHeap[parentIdx*2].value){
		currValue=MaxHeap[parentIdx*2];
		currIdx=parentIdx*2;
	}
	if((parentIdx*2+1)<=heapCount && currValue.value<MaxHeap[parentIdx*2+1].value){
		currValue=MaxHeap[parentIdx*2+1];
		currIdx=parentIdx*2+1;
	}
	if(currIdx==parentIdx)return;
	Heap temp=MaxHeap[parentIdx];
	MaxHeap[parentIdx]=MaxHeap[currIdx];
	MaxHeap[currIdx]=temp;

	heapDown(currIdx);
}

int deleteMax(){
	if(heapCount==0)
		return 1<<30;
	if(heapCount==1){
		heapCount--;
		return MaxHeap[heapCount].value;
	}
	
	Heap deletedValue=MaxHeap[1];
	MaxHeap[1]=MaxHeap[heapCount];
	heapCount--;

	heapDown(1);
	return deletedValue.value;
}

void print(){
	for(int i=1;i<=heapCount;i++)
		printf("%d ",MaxHeap[i].value);
}

int main(){
	int h;
	int value;
	scanf("%d",&h);
	for(int i=0;i<h;i++){
		scanf("%d",&value);
		insert(value);
	}
	print();
	return 0;
}


Compiler output:
main.c: In function 'insert':
main.c:17:17: error: unknown type name 'Heap'; use 'struct' keyword to refer to the type
   17 |                 Heap temp=MaxHeap[currJmlhData];
      |                 ^~~~
      |                 struct 
main.c:17:27: error: incompatible types when initializing type 'int' using type 'struct Heap'
   17 |                 Heap temp=MaxHeap[currJmlhData];
      |                           ^~~~~~~
main.c:19:41: error: incompatible types when assigning to type 'struct Heap' from type 'int'
   19 |                 MaxHeap[currJmlhData/2]=temp;
      |                                         ^~~~
main.c: In function 'heapDown':
main.c:26:9: error: unknown type name 'Heap'; use 'struct' keyword to refer to the type
   26 |         Heap currValue=MaxHeap[parentIdx];
      |         ^~~~
      |         struct 
main.c:26:24: error: incompatible types when initializing type 'int' using type 'struct Heap'
   26 |         Heap currValue=MaxHeap[parentIdx];
      |                        ^~~~~~~
main.c:28:49: error: request for member 'value' in something not a structure or union
   28 |         if((parentIdx*2)<=heapCount && currValue.value<MaxHeap[parentIdx*2].value){
      |                                                 ^
main.c:29:27: error: incompatible types when assigning to type 'int' from type 'struct Heap'
   29 |                 currValue=MaxHeap[parentIdx*2];
      |                           ^~~~~~~
main.c:32:51: error: request for member 'value' in something not a structure or union
   32 |         if((parentIdx*2+1)<=heapCount && currValue.value<MaxHeap[parentIdx*2+1].value){
      |                                                   ^
main.c:33:27: error: incompatible types when assigning to type 'int' from type 'struct Heap'
   33 |                 currValue=MaxHeap[parentIdx*2+1];
      |                           ^~~~~~~
main.c:37:9: error: unknown type name 'Heap'; use 'struct' keyword to refer to the type
   37 |         Heap temp=MaxHeap[parentIdx];
      |         ^~~~
      |         struct 
main.c:37:19: error: incompatible types when initializing type 'int' using type 'struct Heap'
   37 |         Heap temp=MaxHeap[parentIdx];
      |                   ^~~~~~~
main.c:39:26: error: incompatible types when assigning to type 'struct Heap' from type 'int'
   39 |         MaxHeap[currIdx]=temp;
      |                          ^~~~
main.c: In function 'deleteMax':
main.c:52:9: error: unknown type name 'Heap'; use 'struct' keyword to refer to the type
   52 |         Heap deletedValue=MaxHeap[1];
      |         ^~~~
      |         struct 
main.c:52:27: error: incompatible types when initializing type 'int' using type 'struct Heap'
   52 |         Heap deletedValue=MaxHeap[1];
      |                           ^~~~~~~
main.c:57:28: error: request for member 'value' in something not a structure or union
   57 |         return deletedValue.value;
      |                            ^