Language: C

  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("%d ",u->key);
    inorder(u->right);
  }
}

void preorder(Node u){
  if(u!=NIL){
  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 != NIL ) 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:1:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
    1 |   z->left = NIL;
      |    ^~
main.c:2:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
    2 |   z->right = NIL;
      |    ^~
main.c:4:3: error: expected identifier or '(' before 'while'
    4 |   while(x!=NIL){
      |   ^~~~~
main.c:9:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
    9 |     z->parent=y;
      |      ^~
main.c:10:5: error: expected identifier or '(' before 'if'
   10 |     if(y==NIL) root=z;
      |     ^~
main.c:11:5: error: expected identifier or '(' before 'else'
   11 |     else if(z->key<y->key) y->left=z;
      |     ^~~~
main.c:12:5: error: expected identifier or '(' before 'else'
   12 |     else y->right=z;
      |     ^~~~
main.c:13:1: error: expected identifier or '(' before '}' token
   13 | }
      | ^
main.c:15:14: error: unknown type name 'Node'
   15 | void inorder(Node u){
      |              ^~~~
main.c:23:15: error: unknown type name 'Node'
   23 | void preorder(Node u){
      |               ^~~~
main.c: In function 'main':
main.c:34:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   34 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 |   z->left = NIL;
main.c:34:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   34 |   scanf("%d", &n);
      |   ^~~~~
main.c:34:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:40:7: error: unknown type name 'Node'
   40 |       Node t = treeSearch(root, x);
      |       ^~~~
main.c:40:16: error: implicit declaration of function 'treeSearch' [-Wimplicit-function-declaration]
   40 |       Node t = treeSearch(root, x);
      |                ^~~~~~~~~~
main.c:40:27: error: 'root' undeclared (first use in this function)
   40 |       Node t = treeSearch(root, x);
      |                           ^~~~
main.c:40:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:41:17: error: 'NIL' undeclared (first use in this function)
   41 |       if ( t != NIL ) printf("yes\n");
      |                 ^~~
main.c:41:23: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   41 |       if ( t != NIL ) printf("yes\n");
      |                       ^~~~~~
main.c:41:23: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:41:23: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:41:23: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:42:12: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   42 |       else printf("no\n");
      |            ^~~~~~
main.c:42:12: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:45:7: error: implicit declaration of function 'insert' [-Wimplicit-function-declaration]
   45 |       insert(x);
      |       ^~~~~~
main.c:47:7: error: implicit declaration of function 'inorder' [-Wimplicit-function-declaration]
   47 |       inorder(root);
      |       ^~~~~~~
main.c:48:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   48 |       printf("\n");
      |       ^~~~~~
main.c:48:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:49:7: error: implicit declaration of function 'preorder' [-Wimplicit-function-declaration]
   49 |       preorder(root);
      |       ^~~~~~~~
main.c:53:7: error: implicit declaration of function 'treeDelete' [-Wimplicit-function-declaration]
   53 |       treeDelete(treeSearch(root, x));
      |       ^~~~~~~~~~