Language: C

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

#define NIL NULL

struct node{
  struct node *r;
  struct node *l;
  struct node *p;
  int key;
};
typedef struct node * Node;

Node root;

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

  z = (Node *)malloc(sizeof(Node));
  z->key = k;
  z->l = NIL;
  z->r = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->l;
    }
    else{
      x = x->r;
    }
  }

  z->p = y;
  if(y == NIL){
    root = z;
  }
  else{
    if(z->key < y->key){
      y->l = z;
    }
    else{
      y->r = z;
    }
  }
}

void inorder(Node *u){
  if(u == NIL) return;
  printf(" %d", u->key);
  preoder(u->l);
  preoder(u->r);
}


int main(){
  int n, i, x;
  char com;

  scanf("%d", &n);

  for(i = 0 ; i < n ; i++){
    scanf("%s", com);
    if(com == "insert"){
      scanf("%d", &x);
      insert(x);
    }
    else if(com == "print"){
      inorder(root);
      printf("\n");
      preoder(root);
      printf("\n");
    }
  }
  return 0;
}


Compiler output:
main.c: In function 'insert':
main.c:18:13: error: initialization of 'struct node **' from incompatible pointer type 'Node' {aka 'struct node *'} [-Wincompatible-pointer-types]
   18 |   Node *x = root,*y = NIL, *z;
      |             ^~~~
main.c:21:4: error: 'z' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   21 |   z->key = k;
      |    ^~
      |   -
      |   (*z)
main.c:22:4: error: 'z' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   22 |   z->l = NIL;
      |    ^~
      |   -
      |   (*z)
main.c:23:4: error: 'z' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   23 |   z->r = NIL;
      |    ^~
      |   -
      |   (*z)
main.c:27:9: error: 'z' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   27 |     if(z->key < x->key){
      |         ^~
      |        -
      |        (*z)
main.c:27:18: error: 'x' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   27 |     if(z->key < x->key){
      |                  ^~
      |                 -
      |                 (*x)
main.c:28:12: error: 'x' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   28 |       x = x->l;
      |            ^~
      |           -
      |           (*x)
main.c:31:12: error: 'x' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   31 |       x = x->r;
      |            ^~
      |           -
      |           (*x)
main.c:35:4: error: 'z' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   35 |   z->p = y;
      |    ^~
      |   -
      |   (*z)
main.c:37:10: error: assignment to 'Node' {aka 'struct node *'} from incompatible pointer type 'struct node **' [-Wincompatible-pointer-types]
   37 |     root = z;
      |          ^
main.c:40:9: error: 'z' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   40 |     if(z->key < y->key){
      |         ^~
      |        -
      |        (*z)
main.c:40:18: error: 'y' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   40 |     if(z->key < y->key){
      |                  ^~
      |                 -
      |                 (*y)
main.c:41:8: error: 'y' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   41 |       y->l = z;
      |        ^~
      |       -
      |       (*y)
main.c:44:8: error: 'y' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   44 |       y->r = z;
      |        ^~
      |       -
      |       (*y)
main.c: In function 'inorder':
main.c:51:18: error: 'u' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   51 |   printf(" %d", u->key);
      |                  ^~
      |                 -
      |                 (*u)
main.c:52:3: error: implicit declaration of function 'preoder' [-Wimplicit-function-declaration]
   52 |   preoder(u->l);
      |   ^~~~~~~
main.c:52:12: error: 'u' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   52 |   preoder(u->l);
      |            ^~
      |           -
      |           (*u)
main.c:53:12: error: 'u' is a pointer to pointer; did you mean to dereference it before applying '->' to it?
   53 |   preoder(u->r);
      |            ^~
      |           -
      |           (*u)
main.c: In function 'main':
main.c:65:12: warning: comparison between pointer and integer
   65 |     if(com == "insert"){
      |            ^~
main.c:69:17: warning: comparison between pointer and integer
   69 |     else if(com == "print"){
      |                 ^~
main.c:70:15: error: passing argument 1 of 'inorder' from incompatible pointer type [-Wincompatible-pointer-types]
   70 |       inorder(root);
      |               ^~~~
      |               |
      |               Node {aka struct node *}
main.c:49:20: note: expected 'struct node **' but argument is of type 'Node' {aka 'struct node *'}
   49 | void inorder(Node *u){
      |              ~~~~~~^