Language: C

#include <stdio.h>
#define MAX 100005;
#define NO -1;
typedef struct{
	int p;
	int l;
	int r;
}Tree;

Tree tree[MAX];
int count=0;
void pre(int);
void in(int);
void pos(int);

int main(void){
	int n;
	int i;
	int start;

	for(i=0;i<n;i++){
		tree[i].p=tree[i].l=&tree[i].r=NO;
	}

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d",&tree[i].l,&tree[i].r);
		if(tree[i].l != NO) tree[tree[i].l].p=i;
		if(tree[i].l != NO) tree[tree[i].r].p=i;
	}
	for(i=0;i<n;i++){
		if(tree[i].p==NO) start = i;
	}	

	printf("Preorder\n");
	pre(start);
	printf("\n");
	count=0;
	printf("Inorder\n");
	in(start);
	printf("\n");
	count = 0;
	printf("Postorder\n");




	return 0;
}

void pre(int num){
	if(count==0){
		printf("%d\n", num);
		count++;
	}	
	else printf(" %d\n", num);
	if (tree[num].l != NO) pre(tree[num].l);
	if (tree[num].r != NO) pre(tree[num].r);

}

void in(int num){

	if (tree[num].l != NO) pre(tree[num].l);
	if(count==0){
		printf("%d\n", num);
		count++;
	}	
	else printf(" %d\n", num);
	if (tree[num].r != NO) pre(tree[num].r);


}

void pos(int num){

	if (tree[num].l != NO) pre(tree[num].l);
	if (tree[num].r != NO) pre(tree[num].r);
		if(count==0){
		printf("%d\n", num);
		count++;
	}	
	else printf(" %d\n", num);


}

Compiler output:
main.c:2:19: error: expected ']' before ';' token
    2 | #define MAX 100005;
      |                   ^
main.c:10:11: note: in expansion of macro 'MAX'
   10 | Tree tree[MAX];
      |           ^~~
main.c: In function 'main':
main.c:22:17: error: 'tree' undeclared (first use in this function); did you mean 'Tree'?
   22 |                 tree[i].p=tree[i].l=&tree[i].r=NO;
      |                 ^~~~
      |                 Tree
main.c:22:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:28:33: note: in expansion of macro 'NO'
   28 |                 if(tree[i].l != NO) tree[tree[i].l].p=i;
      |                                 ^~
main.c:28:19: note: to match this '('
   28 |                 if(tree[i].l != NO) tree[tree[i].l].p=i;
      |                   ^
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:29:33: note: in expansion of macro 'NO'
   29 |                 if(tree[i].l != NO) tree[tree[i].r].p=i;
      |                                 ^~
main.c:29:19: note: to match this '('
   29 |                 if(tree[i].l != NO) tree[tree[i].r].p=i;
      |                   ^
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:32:31: note: in expansion of macro 'NO'
   32 |                 if(tree[i].p==NO) start = i;
      |                               ^~
main.c:32:19: note: to match this '('
   32 |                 if(tree[i].p==NO) start = i;
      |                   ^
main.c: In function 'pre':
main.c:57:13: error: 'tree' undeclared (first use in this function); did you mean 'Tree'?
   57 |         if (tree[num].l != NO) pre(tree[num].l);
      |             ^~~~
      |             Tree
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:57:28: note: in expansion of macro 'NO'
   57 |         if (tree[num].l != NO) pre(tree[num].l);
      |                            ^~
main.c:57:12: note: to match this '('
   57 |         if (tree[num].l != NO) pre(tree[num].l);
      |            ^
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:58:28: note: in expansion of macro 'NO'
   58 |         if (tree[num].r != NO) pre(tree[num].r);
      |                            ^~
main.c:58:12: note: to match this '('
   58 |         if (tree[num].r != NO) pre(tree[num].r);
      |            ^
main.c: In function 'in':
main.c:64:13: error: 'tree' undeclared (first use in this function); did you mean 'Tree'?
   64 |         if (tree[num].l != NO) pre(tree[num].l);
      |             ^~~~
      |             Tree
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:64:28: note: in expansion of macro 'NO'
   64 |         if (tree[num].l != NO) pre(tree[num].l);
      |                            ^~
main.c:64:12: note: to match this '('
   64 |         if (tree[num].l != NO) pre(tree[num].l);
      |            ^
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:70:28: note: in expansion of macro 'NO'
   70 |         if (tree[num].r != NO) pre(tree[num].r);
      |                            ^~
main.c:70:12: note: to match this '('
   70 |         if (tree[num].r != NO) pre(tree[num].r);
      |            ^
main.c: In function 'pos':
main.c:77:13: error: 'tree' undeclared (first use in this function); did you mean 'Tree'?
   77 |         if (tree[num].l != NO) pre(tree[num].l);
      |             ^~~~
      |             Tree
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:77:28: note: in expansion of macro 'NO'
   77 |         if (tree[num].l != NO) pre(tree[num].l);
      |                            ^~
main.c:77:12: note: to match this '('
   77 |         if (tree[num].l != NO) pre(tree[num].l);
      |            ^
main.c:3:14: error: expected ')' before ';' token
    3 | #define NO -1;
      |              ^
main.c:78:28: note: in expansion of macro 'NO'
   78 |         if (tree[num].r != NO) pre(tree[num].r);
      |                            ^~
main.c:78:12: note: to match this '('
   78 |         if (tree[num].r != NO) pre(tree[num].r);
      |            ^