Language: C

#include<stdio.h>
#include<stdlib.h>
#define NIL NULL

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

Node root;

Node treeMinimum(Node x){
  while(x.left != NIL) {
    x = x.left;
  }
  return x;
}

Node treeMaximum(Node x){
  while(x.right != NIL) {
    x = x.right;
  }
  return x;

}

Node treeSearch(Node u, int k){
  if(x == NIL || k == x.key) return x;
  if(k < x.key) return treeSearch(x.left,k);
  else return treeSreach(x.right,k);

}

Node treeSuccessor(Node x){
  if(x.right != NIL) return treeMinimum(x.right);

  y = x.p;
  while(y != NIL && x == y.right) {
    x = y;
    y = y.p;
  }
  return y;

}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y
  if(z.left == NIL || z.right ==NIL) y = z;
  else y = Tree - Successor(z);

  if(y.left != NIL) x = y.left;
  else x = y.right;

  if(x != NIL) x.p = y.p;

  if(y.p == NIL) T.root = x;
  else if(y == y.p.left) y.p.left = x;
  else y.p.right = x;

  if(y != z) z.key = y.key;


}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  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->left = z;
  else y->right = z;



}

void inorder(Node u){
  if(u==NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u==NIL) return;
    printf(" %d",u->key);
    preorderTreeWalk(u->left);
    preorderTreeWalk(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: In function 'treeMinimum':
main.c:17:10: error: 'x' is a pointer; did you mean to use '->'?
   17 |   while(x.left != NIL) {
      |          ^
      |          ->
main.c:18:10: error: 'x' is a pointer; did you mean to use '->'?
   18 |     x = x.left;
      |          ^
      |          ->
main.c: In function 'treeMaximum':
main.c:24:10: error: 'x' is a pointer; did you mean to use '->'?
   24 |   while(x.right != NIL) {
      |          ^
      |          ->
main.c:25:10: error: 'x' is a pointer; did you mean to use '->'?
   25 |     x = x.right;
      |          ^
      |          ->
main.c: In function 'treeSearch':
main.c:32:6: error: 'x' undeclared (first use in this function)
   32 |   if(x == NIL || k == x.key) return x;
      |      ^
main.c:32:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:15: error: implicit declaration of function 'treeSreach'; did you mean 'treeSearch'? [-Wimplicit-function-declaration]
   34 |   else return treeSreach(x.right,k);
      |               ^~~~~~~~~~
      |               treeSearch
main.c: In function 'treeSuccessor':
main.c:39:7: error: 'x' is a pointer; did you mean to use '->'?
   39 |   if(x.right != NIL) return treeMinimum(x.right);
      |       ^
      |       ->
main.c:39:42: error: 'x' is a pointer; did you mean to use '->'?
   39 |   if(x.right != NIL) return treeMinimum(x.right);
      |                                          ^
      |                                          ->
main.c:41:3: error: 'y' undeclared (first use in this function)
   41 |   y = x.p;
      |   ^
main.c:41:8: error: 'x' is a pointer; did you mean to use '->'?
   41 |   y = x.p;
      |        ^
      |        ->
main.c: In function 'treeDelete':
main.c:53:7: error: 'z' is a pointer; did you mean to use '->'?
   53 |   if(z.left == NIL || z.right ==NIL) y = z;
      |       ^
      |       ->
main.c:53:24: error: 'z' is a pointer; did you mean to use '->'?
   53 |   if(z.left == NIL || z.right ==NIL) y = z;
      |                        ^
      |                        ->
main.c:54:12: error: 'Tree' undeclared (first use in this function); did you mean 'free'?
   54 |   else y = Tree - Successor(z);
      |            ^~~~
      |            free
main.c:54:19: error: implicit declaration of function 'Successor'; did you mean 'treeSuccessor'? [-Wimplicit-function-declaration]
   54 |   else y = Tree - Successor(z);
      |                   ^~~~~~~~~
      |                   treeSuccessor
main.c:56:7: error: 'y' is a pointer; did you mean to use '->'?
   56 |   if(y.left != NIL) x = y.left;
      |       ^
      |       ->
main.c:56:26: error: 'y' is a pointer; did you mean to use '->'?
   56 |   if(y.left != NIL) x = y.left;
      |                          ^
      |                          ->
main.c:57:13: error: 'y' is a pointer; did you mean to use '->'?
   57 |   else x = y.right;
      |             ^
      |             ->
main.c:59:17: error: 'x' is a pointer; did you mean to use '->'?
   59 |   if(x != NIL) x.p = y.p;
      |                 ^
      |                 ->
main.c:59:23: error: 'y' is a pointer; did you mean to use '->'?
   59 |   if(x != NIL) x.p = y.p;
      |                       ^
      |                       ->
main.c:61:7: error: 'y' is a pointer; did you mean to use '->'?
   61 |   if(y.p == NIL) T.root = x;
      |       ^
      |       ->
main.c:61:18: error: 'T' undeclared (first use in this function)
   61 |   if(y.p == NIL) T.root = x;
      |                  ^
main.c:62:17: error: 'y' is a pointer; did you mean to use '->'?
   62 |   else if(y == y.p.left) y.p.left = x;
      |                 ^
      |                 ->
main.c:62:27: error: 'y' is a pointer; did you mean to use '->'?
   62 |   else if(y == y.p.left) y.p.left = x;
      |                           ^
      |                           ->
main.c:63:9: error: 'y' is a pointer; did you mean to use '->'?
   63 |   else y.p.right = x;
      |         ^
      |         ->
main.c:65:15: error: 'z' is a pointer; did you mean to use '->'?
   65 |   if(y != z) z.key = y.key;
      |               ^
      |               ->
main.c:65:23: error: 'y' is a pointer; did you mean to use '->'?
   65 |   if(y != z) z.key = y.key;
      |                       ^
      |                       ->
main.c: In function 'insert':
main.c:84:4: error: 'struct node' has no member named 'p'
   84 |   z->p = y;
      |    ^~
main.c: In function 'preorder':
main.c:103:5: error: implicit declaration of function 'preorderTreeWalk' [-Wimplicit-function-declaration]
  103 |     preorderTreeWalk(u->left);
      |     ^~~~~~~~~~~~~~~~