Language: C

#include <stdio.h>
#include<string.h>



struct node{
    int me;
    Tree *parent;
    Tree *left;
    Tree *right;
    
};
 struct node *Tree,*END;
int number;

void input(void){
    char str[100];
    int n;
    int i;
    scanf("%d",&number);
    for(i=0;i<number;i++){
        scanf("%s",str);
        if(strcmp(str,"insert")){
            scanf("%d",&n);
        insert(n);
        }
        else if(strcmp(str,"print")==1){
            Inorder(Tree);
            printf("\n");
            Preorder(Tree);
            printf("\n");
        }
    }
    
    
}

void insert(int n){
    struct node *a=Tree;
    struct node *b=END;
    struct node *c;
    
    c->me=n;
    c->left=END;
    c->right=END;
    
    
    while(b!=END){
        b=a;
        if(c->me < a->me){
            a=a->left;
                    }else {
                        a=a->right;
                    }
                    
                    
    }
    
    c->parent=b;
    if(b==END){
        Tree=c;
        
    }else{
        if(c->me < b-> me){
            b->left=c;
            
            
        }else{
            b->right=c;
        }
        
    }
    
    
    
}

void inorder(struct node *a){
    if(a==END)return;
    inorder(a->left);
    printf("%d",a->me);
    inorder(a->right);
    
    
}

void preorder(struct node *a){
    if(a==END)return;
    printf("%d",a->me);
    preorder(a->left);
    preorder(a->right);
    
}


int main(void) {
    
    input();    
	return 0;
	
}



Compiler output:
main.c:8:5: error: unknown type name 'Tree'
    8 |     Tree *parent;
      |     ^~~~
main.c:9:5: error: unknown type name 'Tree'
    9 |     Tree *left;
      |     ^~~~
main.c:10:5: error: unknown type name 'Tree'
   10 |     Tree *right;
      |     ^~~~
main.c: In function 'input':
main.c:25:9: error: implicit declaration of function 'insert' [-Wimplicit-function-declaration]
   25 |         insert(n);
      |         ^~~~~~
main.c:28:13: error: implicit declaration of function 'Inorder' [-Wimplicit-function-declaration]
   28 |             Inorder(Tree);
      |             ^~~~~~~
main.c:30:13: error: implicit declaration of function 'Preorder' [-Wimplicit-function-declaration]
   30 |             Preorder(Tree);
      |             ^~~~~~~~
main.c: At top level:
main.c:38:6: warning: conflicting types for 'insert'; have 'void(int)'
   38 | void insert(int n){
      |      ^~~~~~
main.c:25:9: note: previous implicit declaration of 'insert' with type 'void(int)'
   25 |         insert(n);
      |         ^~~~~~
main.c: In function 'insert':
main.c:44:12: error: assignment to 'int *' from incompatible pointer type 'struct node *' [-Wincompatible-pointer-types]
   44 |     c->left=END;
      |            ^
main.c:45:13: error: assignment to 'int *' from incompatible pointer type 'struct node *' [-Wincompatible-pointer-types]
   45 |     c->right=END;
      |             ^
main.c:51:14: error: assignment to 'struct node *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   51 |             a=a->left;
      |              ^
main.c:53:26: error: assignment to 'struct node *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   53 |                         a=a->right;
      |                          ^
main.c:59:14: error: assignment to 'int *' from incompatible pointer type 'struct node *' [-Wincompatible-pointer-types]
   59 |     c->parent=b;
      |              ^
main.c:65:20: error: assignment to 'int *' from incompatible pointer type 'struct node *' [-Wincompatible-pointer-types]
   65 |             b->left=c;
      |                    ^
main.c:69:21: error: assignment to 'int *' from incompatible pointer type 'struct node *' [-Wincompatible-pointer-types]
   69 |             b->right=c;
      |                     ^
main.c: In function 'inorder':
main.c:80:14: error: passing argument 1 of 'inorder' from incompatible pointer type [-Wincompatible-pointer-types]
   80 |     inorder(a->left);
      |             ~^~~~~~
      |              |
      |              int *
main.c:78:27: note: expected 'struct node *' but argument is of type 'int *'
   78 | void inorder(struct node *a){
      |              ~~~~~~~~~~~~~^
main.c:82:14: error: passing argument 1 of 'inorder' from incompatible pointer type [-Wincompatible-pointer-types]
   82 |     inorder(a->right);
      |             ~^~~~~~~
      |              |
      |              int *
main.c:78:27: note: expected 'struct node *' but argument is of type 'int *'
   78 | void inorder(struct node *a){
      |              ~~~~~~~~~~~~~^
main.c: In function 'preorder':
main.c:90:15: error: passing argument 1 of 'preorder' from incompatible pointer type [-Wincompatible-pointer-types]
   90 |     preorder(a->left);
      |              ~^~~~~~
      |               |
      |               int *
main.c:87:28: note: expected 'struct node *' but argument is of type 'int *'
   87 | void preorder(struct node *a){
      |               ~~~~~~~~~~~~~^
main.c:91:15: error: passing argument 1 of 'preorder' from incompatible pointer type [-Wincompatible-pointer-types]
   91 |     preorder(a->right);
      |              ~^~~~~~~
      |               |
      |               int *
main.c:87:28: note: expected 'struct node *' but argument is of type 'int *'
   87 | void preorder(struct node *a){
      |               ~~~~~~~~~~~~~^