criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
public class treework {
	static Node[] list;
    public static void main(String[] args){
    	Scanner sc=new Scanner(System.in);
    	int n=sc.nextInt();
    	list =new Node[n];
    	
    	int num,ri,le;
    	for(int i=0;i<n;i++){
    		list[i]=new Node();
    	}
    	for(int i=0;i<n;i++){
    		num=sc.nextInt();
    		list[i].number=num;
    		le=sc.nextInt();
    		ri=sc.nextInt();
    		if(ri==-1){
    			list[i].right=null;
    		}else{
    			list[i].right=list[ri];
    			list[ri].pid=i;
    		}
    		if(le==-1){
    			list[i].left=null;
    		}else{
    			list[i].left=list[le];
    			list[le].pid=i;
    		}
    		
    	}
    	System.out.println("Preorder");
    	for(int i=0;i<n;i++){
    		if(list[i].pid==-1){
    			preorder(list[i]);
    		}
    	}
    	System.out.print("\n");
    	System.out.println("Inorder");
    	for(int i=0;i<n;i++){
    		if(list[i].pid==-1){
    			inorder(list[i]);
    		}
    	}
    	System.out.print("\n");
    	System.out.println("Postorder");
    	for(int i=0;i<n;i++){
    		if(list[i].pid==-1){
    			postorder(list[i]);
    		}
    	}
    	System.out.print("\n");
}
    static void preorder(Node node){
    	System.out.print(" ");
    	System.out.print(node.number);
    	if(node.left!=null){
    		preorder(node.left);
    	}
    	if(node.right!=null){
    		preorder(node.right);
    	}
    }
    static void inorder(Node node){
    	if(node.left!=null){
    		inorder(node.left);
    	}
    	System.out.print(" ");
    	System.out.print(node.number);
    	if(node.right!=null){
    		inorder(node.right);
        }
    }
    static void postorder(Node node){
    	if(node.left!=null){
    		postorder(node.left);
    	}
    	if(node.right!=null){
    		postorder(node.right);
        }
    	System.out.print(" ");
    	System.out.print(node.number);
    }	
}
class Node{
	int number;
	int pid;
	Node left;
	Node right;
	Node(){
		pid=-1;
		number=0;
		left=null;
		right=null;
	}
}


Compiler output:
Main.java:2: error: class treework is public, should be declared in a file named treework.java
public class treework {
       ^
1 error
Language: C

include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node {
  int l,p,r;
};
  struct Node A[MAX];
int n;

void pre(int x){
  if(x==NIL)return;
  printf(" %d",x);
  pre(A[x].l);
  pre(A[x].r);
}

void in(int x){
  if(x==NIL)return;
  in(A[x].l);
  printf(" %d",x);
  in(A[x].r);
}

void post(int x){
  if(x==NIL)return;
  post(A[x].l);
  post(A[x].r);
  printf(" %d",x);
}

int main(){
  int i,v,l,r,root;

  scanf("%d",&n);

  for(i=0;i<n;i++)A[i].p=NIL;

  for(i=0;i<n;i++){
    scanf("%d %d %d",&v,&l,&r);
    A[i].l=l;
    A[i].r=r;
    if(l!=NIL)A[l].p=v;
    if(r!=NIL)A[r].p=v;
  }
  for(i=0;i<n;i++)if(A[i].p==NIL)root=i;

  printf("Preorder\n");
  pre(root);
  printf("\n");
  printf("Inorder\n");
  in(root);
printf("\n");
  printf("Postorder\n");
  post(root);
  printf("\n");

  return 0;
}




Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c:8:15: error: array type has incomplete element type 'struct Node'
    8 |   struct Node A[MAX];
      |               ^
main.c: In function 'pre':
main.c:13:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   printf(" %d",x);
      |   ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:13:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 |   printf(" %d",x);
      |   ^~~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'in':
main.c:21:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   21 |   printf(" %d",x);
      |   ^~~~~~
main.c:21:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'post':
main.c:29:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   29 |   printf(" %d",x);
      |   ^~~~~~
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'main':
main.c:35:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   35 |   scanf("%d",&n);
      |   ^~~~~
main.c:35:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:35:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:35:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:48:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   48 |   printf("Preorder\n");
      |   ^~~~~~
main.c:48:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node { int p, l, r; };
struct Node T[MAX];
int n;


void preParse(int u) {
  if ( u == NIL ) return;
  printf(" %d", u);
  preParse(T[u].l);
  preParse(T[u].r);
}


void inParse(int u) {
  if ( u == NIL ) return;
  inParse(T[u].l);
  printf(" %d", u);
  inParse(T[u].r);
}


void postParse(int u) {
  if ( u == NIL ) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d", u);
}

int main() {
  int i, v, l, r, root;

  scanf("%d", &n);
  for ( i = 0; i < n; i++ ) {
    T[i].p = NIL;
  }

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

  for ( i = 0; i < n; i++ ) if ( T[i].p == NIL ) root = i;

  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");

  retirn 0;
}
    



Compiler output:
main.c: In function 'main':
main.c:61:3: error: 'retirn' undeclared (first use in this function)
   61 |   retirn 0;
      |   ^~~~~~
main.c:61:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:61:9: error: expected ';' before numeric constant
   61 |   retirn 0;
      |         ^~
      |         ;
Language: C

#include"iostream"
#include"vector"
#include"stdio.h"
using namespace std;
class branch
{
public:
  int id;
  int p;
  int sibling;
  int right;
  int left;
};
vector<branch> tree;
int preParse(int id)
{
  if(id==-1)
    {
      return 0;
    }
  cout<<" "<<id;
  preParse(tree[id].left);
  preParse(tree[id].right);
}
int inParse(int id)
{
  if(id==-1)
    {
      return 0;
    }
  inParse(tree[id].left);
  cout<<" "<<id;
  inParse(tree[id].right);
}
int postParse(int id)
{
  if(id==-1)
    {
      return 0;
    }
  postParse(tree[id].left);
  postParse(tree[id].right);
  cout<<" "<<id;
}
int main()
{
  branch buf;
  buf.p=-1;
  buf.sibling=-1;
  int n;
  int hId;
  cin>>n;
  for(int i=0;i<n;i++)
    {
      tree.push_back(buf);
    }
  for(int i=0;i<n;i++)
    {
      int id;
      int right,left;
      cin>>id;
      tree[id].id=id;
      cin>>left;
      tree[id].left=left;
      cin>>right;
      tree[id].right=right;
      if(right!=-1)
        {
          tree[right].p=id;
          tree[right].sibling=left;
        }
      if(left!=-1)
        {
          tree[left].p=id;
          tree[left].sibling=right;
        }
    }
  for(int i=0;i<tree.size();i++)
    {
      if(tree[i].p==-1)
        {
          hId=tree[i].id;
        }
    }
  cout<<"Preorder"<<endl;
  preParse(hId);
  cout<<endl;
  cout<<"Inorder"<<endl;
  inParse(hId);
  cout<<endl;
  cout<<"Postorder"<<endl;
  postParse(hId);
  cout<<endl;
  return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include"iostream"
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
  int id;
  struct Node *p;
  struct Node *c;
}node;
void preorder(node*);
void inorder(node*);
void postorder(node*);

int main(){

  int i,j;
  int a,n;
  int id,k;

  //input
  scanf("%d",&n);
  node tree[n];
  for(i=0;i<n;i++){
    tree[i].p=NULL;
  }
  for(i=0;i<n;i++){
    scanf("%d%d",&id);
    tree[id].id=id; 
    tree[id].c=(node*)malloc(2*sizeof(node));
    for(j=0;j<2;j++){
      scanf("%d",&tree[id].c[j].id);
      tree[tree[id].c[j].id].p=&tree[id];
    }
  }
  for(i=0;i<n;i++){
    if(tree[i].p==NULL )root=&tree[i];
  }
  //output
  for(i=0;i<n;i++){
    printf("node %d: ",i);
    printf("Preorder\n");
    preorder(root);
    printf("Ineorder\n");
    inorder(root);
    printf("Postorder\n");
    postorder(root);
    drowchildren(tree[i]);
  }
  
  //free 
  for(i=0;i<n;i++){
    free(tree[i].c);
  }
  return 0;
}
void inorder(Node u){

  if(u!=NULL){
    inorder(u->c[0]);
    printf(" %d",u->id);
    inorder(u->c[1]);
  }
}
void preorder(Node u){
  
  if(u==NULL) return;  
  printf(" %d",u->id);
  preorder(u->c[0]);
  preorder(u->c[1]);
}

void postorder(node*){
  if(u==NULL) return;
  postorder(u->c[0]);
  postorder(u->c[1]);
  printf(" %d",u->id);
}



Compiler output:
main.c: In function 'main':
main.c:34:25: error: 'root' undeclared (first use in this function)
   34 |     if(tree[i].p==NULL )root=&tree[i];
      |                         ^~~~
main.c:34:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:45:5: error: implicit declaration of function 'drowchildren' [-Wimplicit-function-declaration]
   45 |     drowchildren(tree[i]);
      |     ^~~~~~~~~~~~
main.c: At top level:
main.c:54:14: error: unknown type name 'Node'; did you mean 'node'?
   54 | void inorder(Node u){
      |              ^~~~
      |              node
main.c:62:15: error: unknown type name 'Node'; did you mean 'node'?
   62 | void preorder(Node u){
      |               ^~~~
      |               node
main.c: In function 'postorder':
main.c:71:6: error: 'u' undeclared (first use in this function)
   71 |   if(u==NULL) return;
      |      ^
Language: C

#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
  int id;
  struct Node *p;
  struct Node *c;
}node;
void preorder(node*);
void inorder(node*);
void postorder(node*);

int main(){

  int i,j;
  int a,n;
  int id,k;

  //input
  scanf("%d",&n);
  node tree[n];
  for(i=0;i<n;i++){
    tree[i].p=NULL;
  }
  for(i=0;i<n;i++){
    scanf("%d%d",&id);
    tree[id].id=id; 
    tree[id].c=(node*)malloc(2*sizeof(node));
    for(j=0;j<2;j++){
      scanf("%d",&tree[id].c[j].id);
      tree[tree[id].c[j].id].p=&tree[id];
    }
  }
  for(i=0;i<n;i++){
    if(tree[i].p==NULL )root=&tree[i];
  }
  //output
  for(i=0;i<n;i++){
    printf("node %d: ",i);
    printf("Preorder\n");
    preorder(root);
    printf("Ineorder\n");
    inorder(root);
    printf("Postorder\n");
    postorder(root);
    drowchildren(tree[i]);
  }
  
  //free 
  for(i=0;i<n;i++){
    free(tree[i].c);
  }
  return 0;
}
void inorder(Node u){

  if(u!=NULL){
    inorder(&u->c[0]);
    printf(" %d",u->id);
    inorder(&u->c[1]);
  }
}
void preorder(Node u){
  
  if(u==NULL) return;  
  printf(" %d",u->id);
  preorder(&u->c[0]);
  preorder(&u->c[1]);
}

void postorder(node*){
  if(u==NULL) return;
  postorder(&u->c[0]);
  postorder(&u->c[1]);
  printf(" %d",u->id);
}



Compiler output:
main.c: In function 'main':
main.c:34:25: error: 'root' undeclared (first use in this function)
   34 |     if(tree[i].p==NULL )root=&tree[i];
      |                         ^~~~
main.c:34:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:45:5: error: implicit declaration of function 'drowchildren' [-Wimplicit-function-declaration]
   45 |     drowchildren(tree[i]);
      |     ^~~~~~~~~~~~
main.c: At top level:
main.c:54:14: error: unknown type name 'Node'; did you mean 'node'?
   54 | void inorder(Node u){
      |              ^~~~
      |              node
main.c:62:15: error: unknown type name 'Node'; did you mean 'node'?
   62 | void preorder(Node u){
      |               ^~~~
      |               node
main.c: In function 'postorder':
main.c:71:6: error: 'u' undeclared (first use in this function)
   71 |   if(u==NULL) return;
      |      ^
Language: C

#include <iostream>
using namespace std;

static const int maxn=10000;

struct Node {
  int p,l,r;
};

Node T[maxn];

void preParse(int u) {
  if (u==(-1)) {
    return ;
  }
  cout<<" "<<u<<flush;
  preParse(T[u].l);
  preParse(T[u].r);
}
void inParse(int u) {
  if (u==(-1)) {
    return ;
  }
  inParse(T[u].l);
  cout<<" "<<u<<flush;
  inParse(T[u].r);
}
void postParse(int u) {
  if (u==(-1)) {
    return ;
  }
  postParse(T[u].l);
  postParse(T[u].r);
  cout<<" "<<u<<flush;
}

int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  int n;
  cin>>n;
  for (int i=0; i<n; i++) {
    T[i].p=(-1);
  }
  for (int i=0; i<n; i++) {
    int v,l,r;
    cin>>v>>l>>r;
    T[v].l=l;
    T[v].r=r;
    if (l!=(-1)) 
      T[l].p=v;
    
    if (r!=(-1)) 
      T[r].p=v;
    
  }
  int root=0;
  for (int i=0; i<n; i++) {
    if (T[i].p==(-1)) 
      root=i;
  }
  cout<<"Preorder"<<endl;
  preParse(root);
  cout<<endl;
  cout<<"Inorder"<<endl;
  inParse(root);
  cout<<endl;
  cout<<"Postorder"<<endl;
  postParse(root);
  cout<<endl;
  return 0;
}



Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio,h>
#define MAX 10000
#define NIL -1

 struct Node{
          int parent;
          int left;
          int right;
          };

 strcut Node T[MAX];

 void Preorder(int u){
           if(u==NIL)return;
           printf("%d",u);
           Preorder(T[u].left);
           Preorder(T[u].right);
           }

 void Inorder(int u){
           if(u==NIL)return;
           Inorder(T[u].left);
           printf("%d",u);
           Inorder(T[u].right);
           }

 void Postorder(int u){
           if(u==NIL)return;
           Postorder(T[u].left);
           Postorder(T[u].right);
           printf("%d",u);
           }

 int main(){
        int i,n,v,l,r,root;
        scanf("%d",&n);
        for(i=0;i<n;i++){T[i].parent=T[i].left=T[i].right=NIL;
        for(i=0;i<n;i++){
                  scanf("%d%d%d",v,l,r);
                  T[i].left=l;
                  T[i].right=r;
                  T[l].parent=v;
                  T[r].parent=v;
                  }
        for(i=0;i<n;i++){if(T[i].parent==NIL)i=root;}
        Preorder(root);
        Inorder(root);
        Postorder(root);
        return 0;
        }






Compiler output:
main.c:1:9: fatal error: stdio,h: No such file or directory
    1 | #include<stdio,h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<studio.h>
#define MAX 10000
#define NIL -1

 struct Node{
          int parent;
          int left;
          int right;
          };

 strcut Node T[MAX];

 void Preorder(int u){
           if(u==NIL)return;
           printf("%d",u);
           Preorder(T[u].left);
           Preorder(T[u].right);
           }

 void Inorder(int u){
           if(u==NIL)return;
           Inorder(T[u].left);
           printf("%d",u);
           Inorder(T[u].right);
           }

 void Postorder(int u){
           if(u==NIL)return;
           Postorder(T[u].left);
           Postorder(T[u].right);
           printf("%d",u);
           }

 int main(){
        int i,n,v,l,r,root;
        scanf("%d",&n);
        for(i=0;i<n;i++){T[i].parent=T[i].left=T[i].right=NIL;
        for(i=0;i<n;i++){
                  scanf("%d%d%d",v,l,r);
                  T[i].left=l;
                  T[i].right=r;
                  T[l].parent=v;
                  T[r].parent=v;
                  }
        for(i=0;i<n;i++){if(T[i].parent==NIL)i=root;}
        Preorder(root);
        Inorder(root);
        Postorder(root);
        return 0;
        }






Compiler output:
main.c:1:9: fatal error: studio.h: No such file or directory
    1 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#define MAX 10000
#define NIL -1

 struct Node{
          int parent;
          int left;
          int right;
          };

 strcut Node T[MAX];

 void Preorder(int u){
           if(u==NIL)return;
           printf("%d",u);
           Preorder(T[u].left);
           Preorder(T[u].right);
           }

 void Inorder(int u){
           if(u==NIL)return;
           Inorder(T[u].left);
           printf("%d",u);
           Inorder(T[u].right);
           }

 void Postorder(int u){
           if(u==NIL)return;
           Postorder(T[u].left);
           Postorder(T[u].right);
           printf("%d",u);
           }

 int main(){
        int i,n,v,l,r,root;
        scanf("%d",&n);
        for(i=0;i<n;i++){T[i].parent=T[i].left=T[i].right=NIL;
        for(i=0;i<n;i++){
                  scanf("%d%d%d",v,l,r);
                  T[i].left=l;
                  T[i].right=r;
                  T[l].parent=v;
                  T[r].parent=v;
                  }
        for(i=0;i<n;i++){if(T[i].parent==NIL)i=root;}
        Preorder(root);
        Inorder(root);
        Postorder(root);
        return 0;
        }






Compiler output:
main.c:11:2: error: unknown type name 'strcut'; did you mean 'struct'?
   11 |  strcut Node T[MAX];
      |  ^~~~~~
      |  struct
main.c:11:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'T'
   11 |  strcut Node T[MAX];
      |              ^
main.c: In function 'Preorder':
main.c:16:21: error: 'T' undeclared (first use in this function)
   16 |            Preorder(T[u].left);
      |                     ^
main.c:16:21: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'Inorder':
main.c:22:20: error: 'T' undeclared (first use in this function)
   22 |            Inorder(T[u].left);
      |                    ^
main.c: In function 'Postorder':
main.c:29:22: error: 'T' undeclared (first use in this function)
   29 |            Postorder(T[u].left);
      |                      ^
main.c: In function 'main':
main.c:37:26: error: 'T' undeclared (first use in this function)
   37 |         for(i=0;i<n;i++){T[i].parent=T[i].left=T[i].right=NIL;
      |                          ^
main.c:50:9: error: expected declaration or statement at end of input
   50 |         }
      |         ^
Language: C

#include<stdio.h>
#define MAX 10000
#define NIL -1

 struct Node{
          int parent;
          int left;
          int right;
          };

 struct Node T[MAX];

 void Preorder(int u){
           if(u==NIL)return;
           printf("%d",u);
           Preorder(T[u].left);
           Preorder(T[u].right);
           }

 void Inorder(int u){
           if(u==NIL)return;
           Inorder(T[u].left);
           printf("%d",u);
           Inorder(T[u].right);
           }

 void Postorder(int u){
           if(u==NIL)return;
           Postorder(T[u].left);
           Postorder(T[u].right);
           printf("%d",u);
           }

 int main(){
        int i,n,v,l,r,root;
        scanf("%d",&n);
        for(i=0;i<n;i++){T[i].parent=T[i].left=T[i].right=NIL;
        for(i=0;i<n;i++){
                  scanf("%d%d%d",v,l,r);
                  T[i].left=l;
                  T[i].right=r;
                  T[l].parent=v;
                  T[r].parent=v;
                  }
        for(i=0;i<n;i++){if(T[i].parent==NIL)i=root;}
        Preorder(root);
        Inorder(root);
        Postorder(root);
        return 0;
        }






Compiler output:
main.c: In function 'main':
main.c:50:9: error: expected declaration or statement at end of input
   50 |         }
      |         ^
Language: C

#define MAX 10000
#define NIL -1

typedef struct {
	int p, l, r;
} Node;

Node T[MAX];
int n;

void preParse(int u) {
	if (u == NIL) return;
	printf(" %d", u);
	preParse(T[u].l);
	preParse(T[u].r);
}

void inParse(int u) {
	if (u == NIL) return;
	inParse(T[u].l);
	printf(" %d", u);
	inParse(T[u].r);
}

void posParse(int u) {
	if (u == NIL) return;
	posParse(T[u].l);
	posParse(T[u].r);
	printf(" %d", u);
}

int main() {
	int i, v, l, r, root;

	scanf_s("%d", &n);
	for (i = 0; i < n; i++) T[i].p = NIL;

	for (i = 0; i < n; i++) {
		scanf_s("%d %d %d", &v, &l, &r);
		T[v].l = l;
		T[v].r = r;
		if (l != NIL) T[l].p = v;
		if (r != NIL) T[r].p = v;
	}
	
	for (i = 0; i < n; i++) {
		if (T[i].p == NIL) {
			root = i;
		}
	}

	printf("Preorder\n");
	preParse(root);
	printf("\n");
	printf("Inorder\n");
	inParse(root);
	printf("\n");
	printf("Posorder\n");
	posParse(root);
	printf("\n");

	return 0;
}


Compiler output:
main.c: In function 'preParse':
main.c:13:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |         printf(" %d", u);
      |         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #define MAX 10000
main.c:13:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 |         printf(" %d", u);
      |         ^~~~~~
main.c:13:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'inParse':
main.c:21:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   21 |         printf(" %d", u);
      |         ^~~~~~
main.c:21:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'posParse':
main.c:29:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   29 |         printf(" %d", u);
      |         ^~~~~~
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'main':
main.c:35:9: error: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
   35 |         scanf_s("%d", &n);
      |         ^~~~~~~
main.c:52:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   52 |         printf("Preorder\n");
      |         ^~~~~~
main.c:52:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node
{
  int parent;
  int left;
  int right;
};

struct Node T[MAX];
int n;

void preParse(int u)
{
  if ( u == NIL ) return;
  printf("%d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u)
{
  if ( u == NIL ) return;
  inParse(T[u].l);
  printf("%d",u);
  inParse(T[u].r);
}

void postPrse(int u)
{
  if ( u == NIL) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf("%d",u);
}

int main()
{
  int i, v, l, r, root;

  scanf("%d", &n);
  for ( i = 0; i < n; i++ )
    {
      T[i].p = NIL;
    }

  for ( i = 0; i < n; i++)
    {
      scanf("%d %d %d",&v, &l, &r);
      T[v].l = l;
      T[v].r = r;
      if ( l != NIL )T[l].p = v;
      if ( r != NIL )T[r].p = v;
    }
  
  for ( i = 0; i < n; i++) if( T[i].p == NIL)root = i;
  
  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");
  
  return 0;
}

Compiler output:
main.c: In function 'preParse':
main.c:19:16: error: 'struct Node' has no member named 'l'
   19 |   preParse(T[u].l);
      |                ^
main.c:20:16: error: 'struct Node' has no member named 'r'
   20 |   preParse(T[u].r);
      |                ^
main.c: In function 'inParse':
main.c:26:15: error: 'struct Node' has no member named 'l'
   26 |   inParse(T[u].l);
      |               ^
main.c:28:15: error: 'struct Node' has no member named 'r'
   28 |   inParse(T[u].r);
      |               ^
main.c: In function 'postPrse':
main.c:34:3: error: implicit declaration of function 'postParse'; did you mean 'postPrse'? [-Wimplicit-function-declaration]
   34 |   postParse(T[u].l);
      |   ^~~~~~~~~
      |   postPrse
main.c:34:17: error: 'struct Node' has no member named 'l'
   34 |   postParse(T[u].l);
      |                 ^
main.c:35:17: error: 'struct Node' has no member named 'r'
   35 |   postParse(T[u].r);
      |                 ^
main.c: In function 'main':
main.c:46:11: error: 'struct Node' has no member named 'p'
   46 |       T[i].p = NIL;
      |           ^
main.c:52:11: error: 'struct Node' has no member named 'l'
   52 |       T[v].l = l;
      |           ^
main.c:53:11: error: 'struct Node' has no member named 'r'
   53 |       T[v].r = r;
      |           ^
main.c:54:26: error: 'struct Node' has no member named 'p'
   54 |       if ( l != NIL )T[l].p = v;
      |                          ^
main.c:55:26: error: 'struct Node' has no member named 'p'
   55 |       if ( r != NIL )T[r].p = v;
      |                          ^
main.c:58:36: error: 'struct Node' has no member named 'p'
   58 |   for ( i = 0; i < n; i++) if( T[i].p == NIL)root = i;
      |                                    ^
Language: C

#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node
{int p, l, r;};

struct Node T[MAX];
int n;

void preParse(int u)
{
  if ( u == NIL ) return;
  printf("%d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u)
{
  if ( u == NIL ) return;
  inParse(T[u].l);
  printf("%d",u);
  inParse(T[u].r);
}

void postPrse(int u)
{
  if ( u == NIL) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf("%d",u);
}

int main()
{
  int i, v, l, r, root;

  scanf("%d", &n);
  for ( i = 0; i < n; i++ )
    {
      T[i].p = NIL;
    }

  for ( i = 0; i < n; i++)
    {
      scanf("%d %d %d",&v, &l, &r);
      T[v].l = l;
      T[v].r = r;
      if ( l != NIL )T[l].p = v;
      if ( r != NIL )T[r].p = v;
    }
  
  for ( i = 0; i < n; i++) if( T[i].p == NIL)root = i;
  
  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");
  
  return 0;
}

Compiler output:
main.c: In function 'postPrse':
main.c:30:3: error: implicit declaration of function 'postParse'; did you mean 'postPrse'? [-Wimplicit-function-declaration]
   30 |   postParse(T[u].l);
      |   ^~~~~~~~~
      |   postPrse
Language: C

#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node{int p, l, r;};
struct Node T[MAX];
int n;

void preParse(int u)
{
  if ( u == NIL ) return;
  printf("%d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u)
{
  if ( u == NIL ) return;
  inParse(T[u].l);
  printf("%d",u);
  inParse(T[u].r);
}

void postPrse(int u)
{
  if ( u == NIL) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf("%d",u);
}

int main()
{
  int i, v, l, r, root;

  scanf("%d", &n);
  for ( i = 0; i < n; i++ )
    {
      T[i].p = NIL;
    }

  for ( i = 0; i < n; i++)
    {
      scanf("%d %d %d",&v, &l, &r);
      T[v].l = l;
      T[v].r = r;
      if ( l != NIL )T[l].p = v;
      if ( r != NIL )T[r].p = v;
    }
  
  for ( i = 0; i < n; i++) if( T[i].p == NIL) root = i;
  
  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");
  
  return 0;
}

Compiler output:
main.c: In function 'postPrse':
main.c:28:3: error: implicit declaration of function 'postParse'; did you mean 'postPrse'? [-Wimplicit-function-declaration]
   28 |   postParse(T[u].l);
      |   ^~~~~~~~~
      |   postPrse
Language: C

#include<stdio.h>
#define NIL -1

void Preorder(int);
void Inorder(int);
void Postorder(int);


typedef struct{
  int parent;
  int left;
  int right;
}vertex;

int D[25],n;
int ver[25];
vertex Tree[25];

int main(){
  
  int i,l,r;
  
  scanf("%d",&n);
  
  for( i=0 ; i<n ; i++){
    Tree[i].parent = Tree[i].left = Tree[i].right = NIL;
  }
  for( i=0 ; i<n ; i++){
    scanf("%d",&ver[i]);
    
    if(i == 0){
      Tree[ ver[i] ] .parent= NIL;
    }

    scanf("%d",&Tree[ver[i]].left);
    scanf("%d",&Tree[ver[i]].right);
    
    l = Tree[ver[i]].left;
    r = Tree[ver[i]].right;
    Tree[l].parent = Tree[r].parent = ver[i];
  }

  for( i=0 ; i<n ; i++){
    Preorder(i);
    Inorder(i);
    Postorder(i);
  }
 
  return 0;
}

void Preorder(int i){

  printf("Preorder\n");
  printf(" %d",Tree[i].right);
  if(Tree[i].left != NIL) Preorder(Tree[i].left);
    if(Tree[i].right != NIL) Preorder(Tree[i].right);
}

void Inorder(int i){

  printf("Inorder\n");
    if(Tree[i].left != NIL) Inorder(Tree[i].left);
    printf(" %d", Tree[i].right);
    if(Tree[i].right != NIL) Inorder(Tree[i].right);
}  

void Postorder(int i);

  printf("postorder\n");
 if(Tree[i].left != NIL) Postorder(Tree[i].left);
    if(Tree[i].right != NIL) Postorder(Tree[i].right);
    printf(" %d", Tree[i].right);
}

Compiler output:
main.c:70:10: error: expected declaration specifiers or '...' before string constant
   70 |   printf("postorder\n");
      |          ^~~~~~~~~~~~~
main.c:71:2: error: expected identifier or '(' before 'if'
   71 |  if(Tree[i].left != NIL) Postorder(Tree[i].left);
      |  ^~
main.c:72:5: error: expected identifier or '(' before 'if'
   72 |     if(Tree[i].right != NIL) Postorder(Tree[i].right);
      |     ^~
main.c:73:12: error: expected declaration specifiers or '...' before string constant
   73 |     printf(" %d", Tree[i].right);
      |            ^~~~~
main.c:73:19: error: expected declaration specifiers or '...' before 'Tree'
   73 |     printf(" %d", Tree[i].right);
      |                   ^~~~
main.c:74:1: error: expected identifier or '(' before '}' token
   74 | }
      | ^
Language: C

#include<stdio.h>
#define nil -1
typedef struct{
  int p;
  int left;
  int right;
  int sibling;
  int depth;
  int height;
  int degree;
  
}Node;

Node N[100000];
int A[100000];
int count=0;

void Preorder(int );
void Inorder(int);
void Postorder(int);

int main(){

  int i,j,n,c,left,right,degree,tmp,root;

  scanf("%d",&n);
  
   for(i=0;i<n;i++){
    N[i].p=N[i].left=N[i].right=N[i].sibling=nil;
    N[i].depth=N[i].height=N[i].degree=0;
  }
  
  for(i=0;i<n;i++){
    scanf("%d %d %d",&tmp,&left,&right);
    N[tmp].left=left;
    N[tmp].right=right;
    if(left!=-1&&right!=-1){
      N[right].p=tmp;
      N[right].sibling=left;
      N[left].sibling=right;
      N[left].p=tmp;
      N[tmp].degree=2;
    }
    else if(left!=-1&&right==-1){
      N[left].p=tmp;
      N[tmp].degree=1;
    }
    else if(left==-1&&right!=-1){
      N[right].p=tmp;
      N[tmp].degree=1;
    }
  }
 

  for(i=0;i<n;i++)if(N[i].p==nil)root=i;
  
  printf("Preorder\n");
  count=0;
  Preorder(root);
  for(i=0;i<n;i++)printf(" %d",A[i]);
  
  printf("\nInorder\n");
 
  count=0;
  Inorder(root);
  for(i=0;i<n;i++)printf(" %d",A[i]);
  
  printf("\nPostorder\n");
  count=0;
  Postorder(root);
  for(i=0;i<n;i++)printf(" %d",A[i]);
  printf("\n")
  
  return 0;
}


void Preorder(int p){

  if(p==nil) return;

  A[count++]=p;
  Preorder(N[p].left);
  Preorder(N[p].right);
}

void Inorder(int p){
 
 if(p==nil) return;

 Inorder(N[p].left);
 A[count++]=p;
 Inorder(N[p].right);

}

void Postorder(int p){

 if(p==nil) return;
 Postorder(N[p].left);
 Postorder(N[p].right);
 A[count++]=p;
}

Compiler output:
main.c: In function 'main':
main.c:72:15: error: expected ';' before 'return'
   72 |   printf("\n")
      |               ^
      |               ;
   73 | 
   74 |   return 0;
      |   ~~~~~~
Language: C

struct Node T[10000];
int n;

void preParse(int u) {
  if(u == -1){
    return;
  }
  printf(" %d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u) {
  if(u == -1){
    return;
  }
  inParse(T[u].l);
  printf(" %d",u);
  inParse(T[u].r);
}

void postParse(int u) {
  if(u == -1){
    return;
  }
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d",u);
}

int main() {

  int i,v,l,r,root;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d %d",&v,&l,&r);
    T[v].l = l;
    T[v].r = r;
    if(l != -1){
      T[l].p = v;
    }
    if(r != -1){
      T[r].p = v;
    }
  }

  for(i=0;i<n;i++){
    if(T[i].p == -1){
      root = i;
    }
  }

  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");

  return 0;
}

Compiler output:
main.c:1:13: error: array type has incomplete element type 'struct Node'
    1 | struct Node T[10000];
      |             ^
main.c: In function 'preParse':
main.c:8:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |   printf(" %d",u);
      |   ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | struct Node T[10000];
main.c:8:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    8 |   printf(" %d",u);
      |   ^~~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'inParse':
main.c:18:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   18 |   printf(" %d",u);
      |   ^~~~~~
main.c:18:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'postParse':
main.c:28:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   28 |   printf(" %d",u);
      |   ^~~~~~
main.c:28:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'main':
main.c:35:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   35 |   scanf("%d",&n);
      |   ^~~~~
main.c:35:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:35:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:35:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:54:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   54 |   printf("Preorder\n");
      |   ^~~~~~
main.c:54:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
 
typedef struct{
  int id;
  int left;
  int right;
  int parent;
} Node;
 
Node T[25];
 

void Inorder(int x){
  printf(" %d",T[x].id);

  if(T[x].left != -1) 
    Preorder(T[x].left);

  if(T[x].right != -1) 
    Preorder(T[x].right);
}


void Inorder(int x){
  if(T[x].left != -1) 
    Inorder(T[x].left);

  printf(" %d",T[x].id);

  if(T[x].right != -1) 
   Inorder(T[x].right);
}


 void Postorder(int x){
  if(T[x].left != -1) 
    Postorder(T[x].left);

  if(T[x].right != -1) 
    Postorder(T[x].right);

  printf(" %d",T[x].id);
}
 

int main(){
 
  int n,i,j;
  int k,v;


  scanf("%d",&n);
                                                                                                                                    
  for(i=0;i<n;i++) 
   T[i].parent = -1;
 

  for(i = 0 ; i < n ; i++){
    scanf("%d",&v);
    T[v].id = v;
    scanf("%d%d", &T[v].left, &T[v].right);
    T[T[v].left].parent = T[v].id;
    T[T[v].right].parent = T[v].id;
  }
                                                                                                                                     
  
  puts("Preorder");
  Preorder(i);
  puts("");
  puts("Inorder");
  Inorder(i);
  puts("");
  puts("Postorder");
  Postorder(i);
  puts("");
  return 0;
}
 
 

Compiler output:
main.c: In function 'Inorder':
main.c:17:5: error: implicit declaration of function 'Preorder' [-Wimplicit-function-declaration]
   17 |     Preorder(T[x].left);
      |     ^~~~~~~~
main.c: At top level:
main.c:24:6: error: redefinition of 'Inorder'
   24 | void Inorder(int x){
      |      ^~~~~~~
main.c:13:6: note: previous definition of 'Inorder' with type 'void(int)'
   13 | void Inorder(int x){
      |      ^~~~~~~
Language: C

#include <stdio.h>
 
typedef struct{
  int id;
  int left;
  int right;
  int parent;
} Node;
 
Node T[25];
 

void Inorder(int x){
  printf(" %d",T[x].id);

  if(T[x].left != -1) 
    Preorder(T[x].left);

  if(T[x].right != -1) 
    Preorder(T[x].right);
}


void Inorder(int x){
  if(T[x].left != -1) 
    Inorder(T[x].left);

  printf(" %d",T[x].id);

  if(T[x].right != -1) 
   Inorder(T[x].right);
}


 void Postorder(int x){
  if(T[x].left != -1) 
    Postorder(T[x].left);

  if(T[x].right != -1) 
    Postorder(T[x].right);

  printf(" %d",T[x].id);
}
 

int main(){
 
  int n,i,j;
  int k,v;


  scanf("%d",&n);
                                                                                                                                    
  for(i=0;i<n;i++) 
   T[i].parent = -1;
 

  for(i = 0 ; i < n ; i++){
    scanf("%d",&v);
    T[v].id = v;
    scanf("%d%d", &T[v].left, &T[v].right);
    T[T[v].left].parent = T[v].id;
    T[T[v].right].parent = T[v].id;
  }
                                                                                                                                     
  for(i=0;T[i].parent != -1;i++);
  puts("Preorder");
  Preorder(i);
  puts("");
  puts("Inorder");
  Inorder(i);
  puts("");
  puts("Postorder");
  Postorder(i);
  puts("");
  return 0;
}
 
 

Compiler output:
main.c: In function 'Inorder':
main.c:17:5: error: implicit declaration of function 'Preorder' [-Wimplicit-function-declaration]
   17 |     Preorder(T[x].left);
      |     ^~~~~~~~
main.c: At top level:
main.c:24:6: error: redefinition of 'Inorder'
   24 | void Inorder(int x){
      |      ^~~~~~~
main.c:13:6: note: previous definition of 'Inorder' with type 'void(int)'
   13 | void Inorder(int x){
      |      ^~~~~~~
Language: C

#include <stdio.h>
 
typedef struct{
  int id;
  int left;
  int right;
  int parent;
} Node;
 
Node T[25];
 

void Inorder(int x){
  printf(" %d",T[x].id);

  if(T[x].left != -1) 
    Preorder(T[x].left);

  if(T[x].right != -1) 
    Preorder(T[x].right);
}


void Inorder(int x){
  if(T[x].left != -1) 
    Inorder(T[x].left);

  printf(" %d",T[x].id);

  if(T[x].right != -1) 
    Inorder(T[x].right);
}


 void Postorder(int x){
   if(T[x].left != -1) 
     Postorder(T[x].left);

   if(T[x].right != -1) 
     Postorder(T[x].right);

   printf(" %d",T[x].id);
}
 

int main(){
 
  int num,i,j;
  int k,v;


  scanf("%d",&num);
                                                                                                                                    
  for(i=0;i<num;i++) 
   T[i].parent = -1;
 

  for(i = 0 ; i < num ; i++){
    scanf("%d",&v);
    T[v].id = v;
    scanf("%d%d", &T[v].left, &T[v].right);
    T[T[v].left].parent = T[v].id;
    T[T[v].right].parent = T[v].id;
  }
                                                                                                                                     
  for(i = 0 ; T[i].parent != -1 ; i++);
  puts("Preorder");
  Preorder(i);
  puts("");
  puts("Inorder");
  Inorder(i);
  puts("");
  puts("Postorder");
  Postorder(i);
  puts("");

  return 0;
}
 
 

Compiler output:
main.c: In function 'Inorder':
main.c:17:5: error: implicit declaration of function 'Preorder' [-Wimplicit-function-declaration]
   17 |     Preorder(T[x].left);
      |     ^~~~~~~~
main.c: At top level:
main.c:24:6: error: redefinition of 'Inorder'
   24 | void Inorder(int x){
      |      ^~~~~~~
main.c:13:6: note: previous definition of 'Inorder' with type 'void(int)'
   13 | void Inorder(int x){
      |      ^~~~~~~
Language: C

#include <stdio.h>
 
typedef struct{
  int id;
  int left;
  int right;
  int parent;
} Node;
 
Node T[25];
 

void Inorder(int x){
  printf(" %d",T[x].id);

  if(T[x].left != -1) 
    Preorder(T[x].left);

  if(T[x].right != -1) 
    Preorder(T[x].right);
}


void Inorder(int x){
  if(T[x].left != -1) 
    Inorder(T[x].left);

  printf(" %d",T[x].id);

  if(T[x].right != -1) 
    Inorder(T[x].right);
}


 void Postorder(int x){
   if(T[x].left != -1) 
     Postorder(T[x].left);

   if(T[x].right != -1) 
     Postorder(T[x].right);

   printf(" %d",T[x].id);
}
 

int main(){
 
  int num,i,j;
  int k,v;


  scanf("%d",&num);
                                                                                                                                    
  for(i=0;i<num;i++) 
   T[i].parent = -1;
 

  for(i = 0 ; i < num ; i++){
    scanf("%d",&v);
    T[v].id = v;
    scanf("%d%d", &T[v].left, &T[v].right);
    T[T[v].left].parent = T[v].id;
    T[T[v].right].parent = T[v].id;
  }
                                                                                                                                     
  for(i = 0 ; T[i].parent != -1 ; i++){
    puts("Preorder");
    Preorder(i);
    puts("");
    puts("Inorder");
    Inorder(i);
    puts("");
    puts("Postorder");
    Postorder(i);
    puts("");
  }
  return 0;
}
 
 

Compiler output:
main.c: In function 'Inorder':
main.c:17:5: error: implicit declaration of function 'Preorder' [-Wimplicit-function-declaration]
   17 |     Preorder(T[x].left);
      |     ^~~~~~~~
main.c: At top level:
main.c:24:6: error: redefinition of 'Inorder'
   24 | void Inorder(int x){
      |      ^~~~~~~
main.c:13:6: note: previous definition of 'Inorder' with type 'void(int)'
   13 | void Inorder(int x){
      |      ^~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 10000
#define NIL NULL
struct node{
  struct node *l;
  struct node *r;
  struct node *p;
  int key;
};

typedef struct node * Node;
Node root;

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;
  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  
  while(x != NIL){
    y = x;
    if(z->key < x->key)
      x = x->left;
    else{
      x = x->right;
    }
  }
  z->parent = y; 
    if(y==NIL){
      root=z;
    }
    else if(z->key < y->key){
      y->left = z;
    }
    else{
      y->right =z;
    }
}
void inorder(Node u){
  if(u != NIL){
    inorder(u->left);
    printf(" ");
    printf("%d",u->key);
    inorder(u->right);
  }
 
}
void preorder(Node u){ 
    if (u != NIL) {
      printf(" ");
      printf("%d",u->key); 
      preorder(u->l);
      preorder(u->r);
    
    }
}
int main(void) {
  int i;
  int d;
  n = 25;
  for (i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
  for (i = 0; i < n; i++) {
    scanf("%d", &d);
    scanf("%d %d", &T[d].l, &T[d].r);
    T[T[d].l].p = T[T[d].r].p = d;
  }
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'insert':
main.c:21:4: error: 'struct node' has no member named 'left'
   21 |   z->left = NIL;
      |    ^~
main.c:22:4: error: 'struct node' has no member named 'right'
   22 |   z->right = NIL;
      |    ^~
main.c:27:12: error: 'struct node' has no member named 'left'
   27 |       x = x->left;
      |            ^~
main.c:29:12: error: 'struct node' has no member named 'right'
   29 |       x = x->right;
      |            ^~
main.c:32:4: error: 'struct node' has no member named 'parent'
   32 |   z->parent = y;
      |    ^~
main.c:37:8: error: 'struct node' has no member named 'left'
   37 |       y->left = z;
      |        ^~
main.c:40:8: error: 'struct node' has no member named 'right'
   40 |       y->right =z;
      |        ^~
main.c: In function 'inorder':
main.c:45:14: error: 'struct node' has no member named 'left'
   45 |     inorder(u->left);
      |              ^~
main.c:48:14: error: 'struct node' has no member named 'right'
   48 |     inorder(u->right);
      |              ^~
main.c: In function 'main':
main.c:64:3: error: 'n' undeclared (first use in this function)
   64 |   n = 25;
      |   ^
main.c:64:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:65:27: error: 'T' undeclared (first use in this function)
   65 |   for (i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
      |                           ^
main.c: At top level:
main.c:76:3: error: expected identifier or '(' before '}' token
   76 |   }
      |   ^
main.c:77:3: error: expected identifier or '(' before 'return'
   77 |   return 0;
      |   ^~~~~~
main.c:78:1: error: expected identifier or '(' before '}' token
   78 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 10000
#define NIL NULL
struct node{
  struct node *l;
  struct node *r;
  struct node *p;
  int key;
};

typedef struct node * Node;
Node root;

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;
  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  
  while(x != NIL){
    y = x;
    if(z->key < x->key)
      x = x->left;
    else{
      x = x->right;
    }
  }
  z->parent = y; 
    if(y==NIL){
      root=z;
    }
    else if(z->key < y->key){
      y->left = z;
    }
    else{
      y->right =z;
    }
}

//Inorder Walk
void inorder(Node u){
  if(u != NIL){
    inorder(u->left);
    printf(" ");
    printf("%d",u->key);
    inorder(u->right);
  }
 
}
//Preorder Walk
void preorder(Node u){ 
    if (u != NIL) {
      printf(" ");
      printf("%d",u->key); 
      preorder(u->l);
      preorder(u->r);
    
    }
}
int main(void) {
  int i;
  int d;
  n = 25;
  for (i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
  for (i = 0; i < n; i++) {
    scanf("%d", &d);
    scanf("%d %d", &T[d].l, &T[d].r);
    T[T[d].l].p = T[T[d].r].p = d;
  }
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'insert':
main.c:21:4: error: 'struct node' has no member named 'left'
   21 |   z->left = NIL;
      |    ^~
main.c:22:4: error: 'struct node' has no member named 'right'
   22 |   z->right = NIL;
      |    ^~
main.c:27:12: error: 'struct node' has no member named 'left'
   27 |       x = x->left;
      |            ^~
main.c:29:12: error: 'struct node' has no member named 'right'
   29 |       x = x->right;
      |            ^~
main.c:32:4: error: 'struct node' has no member named 'parent'
   32 |   z->parent = y;
      |    ^~
main.c:37:8: error: 'struct node' has no member named 'left'
   37 |       y->left = z;
      |        ^~
main.c:40:8: error: 'struct node' has no member named 'right'
   40 |       y->right =z;
      |        ^~
main.c: In function 'inorder':
main.c:47:14: error: 'struct node' has no member named 'left'
   47 |     inorder(u->left);
      |              ^~
main.c:50:14: error: 'struct node' has no member named 'right'
   50 |     inorder(u->right);
      |              ^~
main.c: In function 'main':
main.c:67:3: error: 'n' undeclared (first use in this function)
   67 |   n = 25;
      |   ^
main.c:67:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:68:27: error: 'T' undeclared (first use in this function)
   68 |   for (i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
      |                           ^
main.c: At top level:
main.c:79:3: error: expected identifier or '(' before '}' token
   79 |   }
      |   ^
main.c:80:3: error: expected identifier or '(' before 'return'
   80 |   return 0;
      |   ^~~~~~
main.c:81:1: error: expected identifier or '(' before '}' token
   81 | }
      | ^