Language: C

void insert(int k){
  Node y = NULL;
  Node x = root;
  Node z;
 
  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NULL;
  z->right = NULL;
 
  while(x != NULL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }else{
      x = x->right;
    }
    z->parent = y;
  }
  if(y == NULL){
    root = z;
  }else if(z->key < y->key){
    y->left = z;
  }else{
    y->right = z; 
  }
}
 
void inorder(Node u){
 if(u != NULL){
     inorder(u->left);
     printf(" %d",u->key);
     inorder(u->right);
   }
}
 
void preorder(Node u){
 if(u != NULL){   
      printf(" %d",u->key);
      preorder(u->left);
      preorder(u->right);
    }
}
 
int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);
 
  for (i = 0;i < n;i++){
    scanf("%s", com);
    if (com[0] == 'f'){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if (t != NULL) printf("yes\n");
      else printf("no\n");
    } else if (com[0] == 'i'){
      scanf("%d", &x);
      insert(x);
    } else if (com[0] == 'p'){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if (com[0] == 'd'){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'insert':
main.c:2:3: error: unknown type name 'Node'
    2 |   Node y = NULL;
      |   ^~~~
main.c:2:12: error: 'NULL' undeclared (first use in this function)
    2 |   Node y = NULL;
      |            ^~~~
main.c:1:1: note: 'NULL' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  +++ |+#include <stddef.h>
    1 | void insert(int k){
main.c:2:12: note: each undeclared identifier is reported only once for each function it appears in
    2 |   Node y = NULL;
      |            ^~~~
main.c:3:3: error: unknown type name 'Node'
    3 |   Node x = root;
      |   ^~~~
main.c:3:12: error: 'root' undeclared (first use in this function)
    3 |   Node x = root;
      |            ^~~~
main.c:4:3: error: unknown type name 'Node'
    4 |   Node z;
      |   ^~~~
main.c:6:7: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    6 |   z = malloc(sizeof(struct node));
      |       ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
  +++ |+#include <stdlib.h>
    1 | void insert(int k){
main.c:6:7: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    6 |   z = malloc(sizeof(struct node));
      |       ^~~~~~
main.c:6:7: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:6:21: error: invalid application of 'sizeof' to incomplete type 'struct node'
    6 |   z = malloc(sizeof(struct node));
      |                     ^~~~~~
main.c:7:4: error: invalid type argument of '->' (have 'int')
    7 |   z->key = k;
      |    ^~
main.c:8:4: error: invalid type argument of '->' (have 'int')
    8 |   z->left = NULL;
      |    ^~
main.c:9:4: error: invalid type argument of '->' (have 'int')
    9 |   z->right = NULL;
      |    ^~
main.c:13:9: error: invalid type argument of '->' (have 'int')
   13 |     if(z->key < x->key){
      |         ^~
main.c:13:18: error: invalid type argument of '->' (have 'int')
   13 |     if(z->key < x->key){
      |                  ^~
main.c:14:12: error: invalid type argument of '->' (have 'int')
   14 |       x = x->left;
      |            ^~
main.c:16:12: error: invalid type argument of '->' (have 'int')
   16 |       x = x->right;
      |            ^~
main.c:18:6: error: invalid type argument of '->' (have 'int')
   18 |     z->parent = y;
      |      ^~
main.c:22:13: error: invalid type argument of '->' (have 'int')
   22 |   }else if(z->key < y->key){
      |             ^~
main.c:22:22: error: invalid type argument of '->' (have 'int')
   22 |   }else if(z->key < y->key){
      |                      ^~
main.c:23:6: error: invalid type argument of '->' (have 'int')
   23 |     y->left = z;
      |      ^~
main.c:25:6: error: invalid type argument of '->' (have 'int')
   25 |     y->right = z;
      |      ^~
main.c: At top level:
main.c:29:14: error: unknown type name 'Node'
   29 | void inorder(Node u){
      |              ^~~~
main.c:37:15: error: unknown type name 'Node'
   37 | void preorder(Node u){
      |               ^~~~
main.c: In function 'main':
main.c:48:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   48 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | void insert(int k){
main.c:48:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   48 |   scanf("%d", &n);
      |   ^~~~~
main.c:48:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:54:7: error: unknown type name 'Node'
   54 |       Node t = treeSearch(root, x);
      |       ^~~~
main.c:54:16: error: implicit declaration of function 'treeSearch' [-Wimplicit-function-declaration]
   54 |       Node t = treeSearch(root, x);
      |                ^~~~~~~~~~
main.c:54:27: error: 'root' undeclared (first use in this function)
   54 |       Node t = treeSearch(root, x);
      |                           ^~~~
main.c:55:16: error: 'NULL' undeclared (first use in this function)
   55 |       if (t != NULL) printf("yes\n");
      |                ^~~~
main.c:55:16: note: 'NULL' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
main.c:55:22: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   55 |       if (t != NULL) printf("yes\n");
      |                      ^~~~~~
main.c:55:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:55:22: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:55:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:56:12: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   56 |       else printf("no\n");
      |            ^~~~~~
main.c:56:12: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:61:7: error: implicit declaration of function 'inorder' [-Wimplicit-function-declaration]
   61 |       inorder(root);
      |       ^~~~~~~
main.c:62:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   62 |       printf("\n");
      |       ^~~~~~
main.c:62:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:63:7: error: implicit declaration of function 'preorder' [-Wimplicit-function-declaration]
   63 |       preorder(root);
      |       ^~~~~~~~
main.c:67:7: error: implicit declaration of function 'treeDelete' [-Wimplicit-function-declaration]
   67 |       treeDelete(treeSearch(root, x));
      |       ^~~~~~~~~~