Language: C

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;



Node insert(Node z){

  Node x,y,root;


  y=NIL;
  x=root;
  while(x!=NIL){
    y=x;
    if(z.key<x.key)
      x=x.left;
    else x=x.right;

    z.p=y;
 
    if(y=NIL)
      root=z;
    else if(z.key<y.key)
      y.key=z;
    else y.right = z;
  }

int main(){
  int n, i, x;
  char T[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", T);
  }

    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: In function 'insert':
main.c:26:9: error: 'z' is a pointer; did you mean to use '->'?
   26 |     if(z.key<x.key)
      |         ^
      |         ->
main.c:26:15: error: 'x' is a pointer; did you mean to use '->'?
   26 |     if(z.key<x.key)
      |               ^
      |               ->
main.c:27:10: error: 'x' is a pointer; did you mean to use '->'?
   27 |       x=x.left;
      |          ^
      |          ->
main.c:28:13: error: 'x' is a pointer; did you mean to use '->'?
   28 |     else x=x.right;
      |             ^
      |             ->
main.c:30:6: error: 'z' is a pointer; did you mean to use '->'?
   30 |     z.p=y;
      |      ^
      |      ->
main.c:34:14: error: 'z' is a pointer; did you mean to use '->'?
   34 |     else if(z.key<y.key)
      |              ^
      |              ->
main.c:34:20: error: 'y' is a pointer; did you mean to use '->'?
   34 |     else if(z.key<y.key)
      |                    ^
      |                    ->
main.c:35:8: error: 'y' is a pointer; did you mean to use '->'?
   35 |       y.key=z;
      |        ^
      |        ->
main.c:36:11: error: 'y' is a pointer; did you mean to use '->'?
   36 |     else y.right = z;
      |           ^
      |           ->
main.c: In function 'main':
main.c:48:10: error: 'com' undeclared (first use in this function)
   48 |     if ( com[0] == 'f' ){
      |          ^~~
main.c:48:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:50:16: error: implicit declaration of function 'treeSearch' [-Wimplicit-function-declaration]
   50 |       Node t = treeSearch(root, x);
      |                ^~~~~~~~~~
main.c:50:16: error: initialization of 'Node' {aka 'struct node *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
main.c:55:14: error: passing argument 1 of 'insert' makes pointer from integer without a cast [-Wint-conversion]
   55 |       insert(x);
      |              ^
      |              |
      |              int
main.c:17:18: note: expected 'Node' {aka 'struct node *'} but argument is of type 'int'
   17 | Node insert(Node z){
      |             ~~~~~^
main.c:57:7: error: implicit declaration of function 'inorder' [-Wimplicit-function-declaration]
   57 |       inorder(root);
      |       ^~~~~~~
main.c:59:7: error: implicit declaration of function 'preorder' [-Wimplicit-function-declaration]
   59 |       preorder(root);
      |       ^~~~~~~~
main.c:63:7: error: implicit declaration of function 'treeDelete' [-Wimplicit-function-declaration]
   63 |       treeDelete(treeSearch(root, x));
      |       ^~~~~~~~~~
main.c: In function 'insert':
main.c:67:3: error: expected declaration or statement at end of input
   67 |   return 0;
      |   ^~~~~~