Language: C

#include<stdio.h>
#include<stdlib.h>

typedef struct{
  int key;
  Tree *r,*l,*p;
}Tree;

 Tree *B,*NIL;

void insert(int k){
   Tree *y = NIL;
   Tree *x = B;
   Tree *z;

   z = (Tree *)malloc(sizeof(Tree));
   z->key = k;
   z->l = NIL;
   z->r = NIL;

   while(x!=NIL){
     y = x;
     
     if(z->key < x->key){
       x = x->l;
     }
     else x = x->r;
   }
   
   z->p = y;
   if(y == NIL ){
     B=z;
   }
   else if(z->key < y->key){
       y->l = z;
     }
   else y->r = z;
}




void inorder(Tree *u){
  if(u==NIL) return;
  inorder(u->l);
  printf(" %d",u->key);
  inorder(u->r);
}

void preorder(Tree *u){
  if(u == NIL )return;
  printf(" %d",u->key);
  preorder(u->l);
  preorder(u->r);
}

int main(){
  
  int i,x,y;
  char G[8];
  scanf("%d",&x);
  
  for(i=0;i<x;i++){
    scanf("%s",&G);
    
    if(G[0] == 'i'){
      scanf("%d",&y);
      insert(y);
    }
    
    else if(G[0] == 'p'){
      inorder(B);
      printf("\n");
      preorder(B);
      printf("\n");
    }
  }
  return 0;
}

  



Compiler output:
main.c:6:3: error: unknown type name 'Tree'
    6 |   Tree *r,*l,*p;
      |   ^~~~
main.c: In function 'insert':
main.c:18:9: error: assignment to 'int *' from incompatible pointer type 'Tree *' [-Wincompatible-pointer-types]
   18 |    z->l = NIL;
      |         ^
main.c:19:9: error: assignment to 'int *' from incompatible pointer type 'Tree *' [-Wincompatible-pointer-types]
   19 |    z->r = NIL;
      |         ^
main.c:25:10: error: assignment to 'Tree *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   25 |        x = x->l;
      |          ^
main.c:27:13: error: assignment to 'Tree *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   27 |      else x = x->r;
      |             ^
main.c:30:9: error: assignment to 'int *' from incompatible pointer type 'Tree *' [-Wincompatible-pointer-types]
   30 |    z->p = y;
      |         ^
main.c:35:13: error: assignment to 'int *' from incompatible pointer type 'Tree *' [-Wincompatible-pointer-types]
   35 |        y->l = z;
      |             ^
main.c:37:14: error: assignment to 'int *' from incompatible pointer type 'Tree *' [-Wincompatible-pointer-types]
   37 |    else y->r = z;
      |              ^
main.c: In function 'inorder':
main.c:45:12: error: passing argument 1 of 'inorder' from incompatible pointer type [-Wincompatible-pointer-types]
   45 |   inorder(u->l);
      |           ~^~~
      |            |
      |            int *
main.c:43:20: note: expected 'Tree *' but argument is of type 'int *'
   43 | void inorder(Tree *u){
      |              ~~~~~~^
main.c:47:12: error: passing argument 1 of 'inorder' from incompatible pointer type [-Wincompatible-pointer-types]
   47 |   inorder(u->r);
      |           ~^~~
      |            |
      |            int *
main.c:43:20: note: expected 'Tree *' but argument is of type 'int *'
   43 | void inorder(Tree *u){
      |              ~~~~~~^
main.c: In function 'preorder':
main.c:53:13: error: passing argument 1 of 'preorder' from incompatible pointer type [-Wincompatible-pointer-types]
   53 |   preorder(u->l);
      |            ~^~~
      |             |
      |             int *
main.c:50:21: note: expected 'Tree *' but argument is of type 'int *'
   50 | void preorder(Tree *u){
      |               ~~~~~~^
main.c:54:13: error: passing argument 1 of 'preorder' from incompatible pointer type [-Wincompatible-pointer-types]
   54 |   preorder(u->r);
      |            ~^~~
      |             |
      |             int *
main.c:50:21: note: expected 'Tree *' but argument is of type 'int *'
   50 | void preorder(Tree *u){
      |               ~~~~~~^