criyle/codenet-compile-errors huggingface dataset:
Language: Java

#include<iostream>
using namespace std;

struct Node{
    int key;
    Node *right, *parent, *left;
};

Node *root;
Node *NIL;

void insert(int k){
    Node *y = NIL;
    Node *x = root; // 走査用
    Node *z;

    z = (Node *)malloc(sizeof(Node));
    z->key = k;
    z->left = NIL;
    z->right = NIL;

    while(x != NIL){
        y = x;
        if(x->key > z->key){
            x = x->left;
        }else{
            x = x->right;
        }
    }

    z->parent = y;
    if(y == NIL){
        root = z;
    }else if(y->key > z->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);
    preorder(u->left);
    preorder(u->right);
}

int main(){
    int n, i, x;
    string com;
    scanf("%d", &n);
    
    for(i = 0; i < n; i++){
        cin >> com;
        if(com == "insert"){
            scanf("%d", &x);
            insert(x);
        }else if(com == "print"){
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }

    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:4: error: class, interface, enum, or record expected
struct Node{
^
Main.java:6: error: class, interface, enum, or record expected
    Node *right, *parent, *left;
    ^
Main.java:7: error: class, interface, enum, or record expected
};
^
Main.java:9: error: class, interface, enum, or record expected
Node *root;
^
Main.java:10: error: class, interface, enum, or record expected
Node *NIL;
^
Main.java:15: error: not a statement
    Node *z;
         ^
Main.java:18: error: not a statement
    z->key = k;
    ^
Main.java:19: error: not a statement
    z->left = NIL;
    ^
Main.java:20: error: not a statement
    z->right = NIL;
    ^
Main.java:31: error: not a statement
    z->parent = y;
    ^
Main.java:35: error: not a statement
        y->left = z;
        ^
Main.java:37: error: not a statement
        y->right = z;
        ^
Main.java:12: error: unnamed classes are a preview feature and are disabled by default.
void insert(int k){
^
  (use --enable-preview to enable unnamed classes)
Main.java:17: error: illegal start of expression
    z = (Node *)malloc(sizeof(Node));
               ^
Main.java:17: error: ';' expected
    z = (Node *)malloc(sizeof(Node));
                ^
Main.java:41: error: <identifier> expected
void inorder(Node *u){
                 ^
Main.java:48: error: <identifier> expected
void preorder(Node *u){
                  ^
Main.java:61: error: not a statement
        cin >> com;
            ^
Main.java:58: error: illegal start of expression
    scanf("%d", &n);
                ^
Main.java:63: error: illegal start of expression
            scanf("%d", &x);
                        ^
22 errors
Language: Java

import java.util.*;
public class Main {
    static Node[] list;
    public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
        int m= sc.nextInt();
        String s;
        int reg=0;
        int flag=1;
        list=new Node[m];
        for(int i=0;i<m;i++) list[i] = new Node();
        
        for(int i=0;i<m;i++){
        	s=sc.next();
        	if(s.equals("insert")){
        		list[i].number=sc.nextLong();
        		if(flag==1){
        			reg=i;
        			list[reg].pid=0;
        			flag=0;
        		}else{
        			insert(list[reg],list,i);
        		}
        	}else if(s.equals("print")){
        		naka(list,list[reg]);
        		System.out.print("\n");
        		mae(list,list[reg]);
        		System.out.print("\n");
        	}
        }
    }
    static void insert(Node node,Node[] list,int i){
        if(list[i].number>node.number){
            if(node.right==null){
            	node.right=list[i];
            }else{
            	insert(node.right,list,i);
            }
        }else {
        	if(node.left==null){
        		node.left=list[i];
        	}else{
        		insert(node.left,list,i);
        	}
        }
    }
    static void mae(Node[] list, Node node){
    	System.out.print(" ");
    	System.out.print(node.number);
    	
    	if(node.left!=null){
    		naka(list,node.left);
    	}
    	if(node.right!=null){
    		naka(list,node.right);
    	}
    }
    static void naka(Node[] list, Node node){
    	if(node.left!=null){
    		naka(list,node.left);
    	}
    	System.out.print(" ");
    	System.out.print(node.number);
    	if(node.right!=null){
    		naka(list,node.right);
    	}
    }
}
public class Node{
	Long number;
	int pid;
	Node left;
	Node right;
	Node(){
		pid=-1;
		number=(long) -1;
		left=null;
		right=null;
	}
}


Compiler output:
Main.java:69: error: class Node is public, should be declared in a file named Node.java
public class Node{
       ^
1 error
Language: C

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

struct Node{
  int key;
  struct Node *right,*left,*parent;
};

struct Node *root,*nil;

void insert(int k){
  struct Node *y = k;
  struct Node *x = nil;
  struct Node *z;

  z = (Node *)malloc(sizeof(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 = ->righr;
    }
  }
  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)return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(Node *u){
  if(u == nil)return;
  printf(" %d",u->key );
  preorder(u->left);
  preorder(u->right);
}

int main(){
  int n,i,x;
  string 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");
      preorder(root);
      printf("\n" );
    }
  }
  return 0;

}



Compiler output:
main.c: In function 'insert':
main.c:13:20: error: initialization of 'struct Node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   13 |   struct Node *y = k;
      |                    ^
main.c:17:8: error: 'Node' undeclared (first use in this function)
   17 |   z = (Node *)malloc(sizeof(Node));
      |        ^~~~
main.c:17:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:14: error: expected expression before ')' token
   17 |   z = (Node *)malloc(sizeof(Node));
      |              ^
main.c:27:11: error: expected expression before '->' token
   27 |       x = ->righr;
      |           ^~
main.c:35:11: error: expected expression before '>' token
   35 |       y - > left = z;
      |           ^
main.c: At top level:
main.c:42:14: error: unknown type name 'Node'
   42 | void inorder(Node *u){
      |              ^~~~
main.c:49:15: error: unknown type name 'Node'
   49 | void preorder(Node *u){
      |               ^~~~
main.c: In function 'main':
main.c:58:3: error: unknown type name 'string'; did you mean 'stdin'?
   58 |   string com;
      |   ^~~~~~
      |   stdin
main.c:64:12: warning: comparison between pointer and integer
   64 |     if(com == "insert"){
      |            ^~
main.c:67:18: warning: comparison between pointer and integer
   67 |     }else if(com == "print"){
      |                  ^~
main.c:68:7: error: implicit declaration of function 'inorder'; did you mean 'index'? [-Wimplicit-function-declaration]
   68 |       inorder(root);
      |       ^~~~~~~
      |       index
main.c:70:7: error: implicit declaration of function 'preorder' [-Wimplicit-function-declaration]
   70 |       preorder(root);
      |       ^~~~~~~~
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 treeMinimum(Node x){


}

Node treeMaximum(Node x){


}

Node treeSearch(Node u, int k){


}

Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}

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 = y;

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

}

void inorder(Node u){

}
void preorder(Node u){

}


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 'insert':
main.c:55:9: error: 'z' is a pointer; did you mean to use '->'?
   55 |     if(z.key < x.key)
      |         ^
      |         ->
main.c:55:17: error: 'x' is a pointer; did you mean to use '->'?
   55 |     if(z.key < x.key)
      |                 ^
      |                 ->
main.c:56:12: error: 'x' is a pointer; did you mean to use '->'?
   56 |       x = x.left;
      |            ^
      |            ->
main.c:58:12: error: 'x' is a pointer; did you mean to use '->'?
   58 |       x = x.right;
      |            ^
      |            ->
main.c:64:12: error: 'z' is a pointer; did you mean to use '->'?
   64 |   else if(z.key < y.key)
      |            ^
      |            ->
main.c:64:20: error: 'y' is a pointer; did you mean to use '->'?
   64 |   else if(z.key < y.key)
      |                    ^
      |                    ->
main.c:65:6: error: 'y' is a pointer; did you mean to use '->'?
   65 |     y.left = z;
      |      ^
      |      ->
main.c:67:6: error: 'y' is a pointer; did you mean to use '->'?
   67 |     y.right = z;
      |      ^
      |      ->
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;



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->parent = y;
  	
  if (y == NIL) root =z;
  
  else if (z->key < y->key) y->left = z;

else y->right = z;
}

void inorder(Node t){
if(t==NIL) return;

inorder(t->left);
printf(" %d",t->key);

inorder(t->right);

}
void preorder(Node u){
if(u==null) return;

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);
    
 else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } 
  }

  return 0;
}




Compiler output:
main.c: In function 'preorder':
main.c:51:7: error: 'null' undeclared (first use in this function)
   51 | if(u==null) return;
      |       ^~~~
main.c:51:7: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:69:2: error: 'else' without a previous 'if'
   69 |  else if ( com[0] == 'i' ){
      |  ^~~~
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 treeMinimum(Node x){

  while(x->right!=NIL){
    x=x->right;
  }
  return x;
}

Node treeMaximum(Node x){


}

Node treeSearch(Node u, int k){


}

Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}

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;

  //code
  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;
  }
  count++;
}

void inorder(Node u){

  if(u!=NIL){
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
  }
}
void preorder(Node u){
  
  if(u==NIL) return;  
  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: In function 'insert':
main.c:77:3: error: 'count' undeclared (first use in this function)
   77 |   count++;
      |   ^~~~~
main.c:77:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;

struct Node{
  int key;
  Node *right,*left,*parent;
};

Node *root, *NIL;

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

  z = (Node *)malloc(sizeof(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->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) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(Node *u){
  if(u==NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}

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

  scanf("%d",&n);

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

  return 0;
}


Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

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

struct Node{
  int key;
  struct Node *r,*l,*p;
};

 struct Node *B,*NIL;

void insert(int k){
   struct Node *y = NIL;
   struct Node *x = B;
   struct Node *z;

   z = (struct Node *)malloc(sizeof(struct 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 ){
     B=z;
   }
   else if(z->key < y->key){
       y->l = z;
     }
   else y->r = z;
}




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

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

int main(){
  
  int i,x,y;
  char G[8];
  scanf("%d",&x);
  
  for(i=0;i<x;i++){
    scanf("%s",&G);
    
    if(G[0] == 'i'){
      scanf("%d",&y);
      insert(y);
    }
    
    else if(G[0] == 'p'){
      inorder(B);
      printf("\n");
      preorder(B);
      printf("\n");
    }
  }
  return 0;
}

  



Compiler output:
In file included from /usr/include/stdlib.h:32,
                 from main.c:2:
main.c:3:13: error: expected identifier or '(' before 'void'
    3 | #define NIL NULL
      |             ^~~~
main.c:10:18: note: in expansion of macro 'NIL'
   10 |  struct Node *B,*NIL;
      |                  ^~~
main.c:3:13: error: expected ')' before numeric constant
    3 | #define NIL NULL
      |             ^~~~
main.c:10:18: note: in expansion of macro 'NIL'
   10 |  struct Node *B,*NIL;
      |                  ^~~
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;

Node root;

Node treeMinmum(Node x){
  while(x->left != NIL) x = x->left;
  return x;
}

Node treeMaxmum(Node x){
  while(x->right != NIL) x = x->right;
  return x;
}

Node treeSearch(Node u, int k){
  if(u==NIL || k==u->key) return u;
  if(k<u->key) return treeSearch(u->left,k);
  else return treeSearch(u->right,k);
}

Node treeSuccessor(Node x){
  Node y=NIL;
  
  if(x->right != NIL) return treeMinmum(x->right);

  y = x->parent;
  while(y != NIL && x == y->right){
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y;
  Node x;

  if(z->left == NIL || z->right == NIL) y = z;
  else y = treeSuccessor(z);

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

  if(x!=NIL) x->parent = y->parent;
  
  if(y->parent == NIL) root = x;
  else if(y==y->parent->left) y->parent->left = x;
  else y->parent->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->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(){
  root = malloc(sizeof(Node));
  root = NIL;
  
  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");
      cnt=0;
      preorder(root);
      printf("\n");
    }else if(com[0]=='d'){
      scanf("%d",&x);
      treeDelete(treeSearch(root,x));
    }
  }

  return 0;
		  
}



Compiler output:
main.c: In function 'main':
main.c:125:7: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
  125 |       cnt=0;
      |       ^~~
      |       int
main.c:125:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

#define N_MAX 500001

struct node{
    int key;
    struct node *right;
    struct node *left;
    struct node *parent;
};

typedef struct node *Node;
Node root = NULL;

void insert(int k){
    Node y = NULL;
    Node x = root;
    Node z;
    
    z = malloc(sizeof(struct node));
    z->key = k;
    z->right = NULL;
    z->left = 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 ino(Node u){
 
  if(u->left != NULL){
 
    ino(u->left);
  }
 
  printf(" %d",u->key);
 
  if(u->right != NULL){
     
    ino(u->right);
  }
 
}
void pre(Node u){
 
  printf(" %d",u->key);
   
  if(u->left != NULL){
    pre(u->left);
  }
   
  if(u->right != NULL){
    pre(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] == 'i' ){
            scanf("%d", &x);
            insert(x);
        } else if ( com[0] == 'p' ){
            pre(root);
            printf("\n");
            init();
            ino(root);
            printf("\n");
        } 
    }
    return 0;
}






Compiler output:
main.c: In function 'main':
main.c:87:13: error: implicit declaration of function 'init' [-Wimplicit-function-declaration]
   87 |             init();
      |             ^~~~
Language: C

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

#define STR_MAX 100
#define MAX_NODE 500001

// ノード型定義
typedef struct _NODE{
    int key;
    struct _NODE *right;
    struct _NODE *left;
} NODE;

// ノード用RAM管理
NODE node_pool[MAX_NODE];
int node_cnt;
NODE *make_node(int key);

// ツリー操作
NODE *insert_tree(NODE *root,int k);
void print_tree(NODE *root);
void print_tree_inorder(NODE *node);
void print_tree_preorder(NODE *node);

/////////////////////////////
// メイン処理
int main(){
    int i;
    int m,k;
    NODE *root;
    char buf[STR_MAX];

    node_cnt = 0;
    root = NULL;

    // 命令数を読み込んでループ
    scanf("%d%*c",&m);
    for( i=0; i<m; i++){
        // 命令を読み込んで処理
        fgets(buf,STR_MAX,stdin);
        if(strncmp(buf,"insert",6)==0){
            // insert
            sscanf(buf,"%*s %d",&k);
            insert_tree(&root,k);
        }else if(strncmp(buf,"print",5)==0){
            // print
            print_tree(root);
        }else{
            //処理なし
        }
    }

    return 0;
}


/////////////////////////////
// ツリー操作

// 要素追加
// ツリーのルートを返す
NODE *insert_tree(NODE *root,int k){
    NODE *new_root = root;
    NODE *y = NULL; // x の親
    NODE *x = root;
    NODE *z = make_node(k);

    while( x != NULL ){
        y = x; // 親を設定
        if( z->key < x->key ){
            x = x->left; // 左の子へ移動
        }else{
            x = x->right; // 右の子へ移動
        }
    }

    new_root = y;

    if( y == NULL){ // T が空の場合
        *root = z;
    }else if( z->key < y->key){
        y->left = z; // z を y の左の子にする
    }else{
        y->right = z; // z を y の右の子にする
    }

    return new_root;
}

// 内容表示
void print_tree(NODE *root){
    print_tree_inorder(root);
    printf("\n");
    print_tree_preorder(root);
    printf("\n");
}
// 中間順巡回
void print_tree_inorder(NODE *node){
    if(node==NULL) return;
    print_tree_inorder(node->left);
    printf(" %d",node->key);
    print_tree_inorder(node->right);
}

// 先行順巡回
void print_tree_preorder(NODE *node){
    if(node==NULL) return;
    printf(" %d",node->key);
    print_tree_preorder(node->left);
    print_tree_preorder(node->right);
}

//////////////////////
//ノード用RAM管理

//新規ノード作成
NODE *make_node(int key){
    NODE *node = &node_pool[node_cnt];
    node_cnt++;
    node->key   = key;
    node->right = NULL;
    node->left  = NULL;
    return node;
}




Compiler output:
main.c: In function 'main':
main.c:44:25: error: passing argument 1 of 'insert_tree' from incompatible pointer type [-Wincompatible-pointer-types]
   44 |             insert_tree(&root,k);
      |                         ^~~~~
      |                         |
      |                         NODE ** {aka struct _NODE **}
main.c:20:25: note: expected 'NODE *' {aka 'struct _NODE *'} but argument is of type 'NODE **' {aka 'struct _NODE **'}
   20 | NODE *insert_tree(NODE *root,int k);
      |                   ~~~~~~^~~~
main.c: In function 'insert_tree':
main.c:80:17: error: incompatible types when assigning to type 'NODE' {aka 'struct _NODE'} from type 'NODE *' {aka 'struct _NODE *'}
   80 |         *root = z;
      |                 ^
Language: C

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

#define STR_MAX 100
#define MAX_NODE 500001

// ノード型定義
typedef struct _NODE{
    int key;
    struct _NODE *right;
    struct _NODE *left;
} NODE;

// ノード用RAM管理
NODE node_pool[MAX_NODE];
int node_cnt;
NODE *make_node(int key);

// ツリー操作
NODE *insert_tree(NODE *root,int k);
void print_tree(NODE *root);
void print_tree_inorder(NODE *node);
void print_tree_preorder(NODE *node);

/////////////////////////////
// メイン処理
int main(){
    int i;
    int m,k;
    NODE *root;
    char buf[STR_MAX];

    node_cnt = 0;
    root = NULL;

    // 命令数を読み込んでループ
    scanf("%d%*c",&m);
    for( i=0; i<m; i++){
        // 命令を読み込んで処理
        fgets(buf,STR_MAX,stdin);
        if(strncmp(buf,"insert",6)==0){
            // insert
            sscanf(buf,"%*s %d",&k);
            insert_tree(root,k);
        }else if(strncmp(buf,"print",5)==0){
            // print
            print_tree(root);
        }else{
            //処理なし
        }
    }

    return 0;
}


/////////////////////////////
// ツリー操作

// 要素追加
// ツリーのルートを返す
NODE *insert_tree(NODE *root,int k){
    NODE *new_root = root;
    NODE *y = NULL; // x の親
    NODE *x = root;
    NODE *z = make_node(k);

    while( x != NULL ){
        y = x; // 親を設定
        if( z->key < x->key ){
            x = x->left; // 左の子へ移動
        }else{
            x = x->right; // 右の子へ移動
        }
    }

    new_root = y;

    if( y == NULL){ // T が空の場合
        *root = z;
    }else if( z->key < y->key){
        y->left = z; // z を y の左の子にする
    }else{
        y->right = z; // z を y の右の子にする
    }

    return new_root;
}

// 内容表示
void print_tree(NODE *root){
    print_tree_inorder(root);
    printf("\n");
    print_tree_preorder(root);
    printf("\n");
}
// 中間順巡回
void print_tree_inorder(NODE *node){
    if(node==NULL) return;
    print_tree_inorder(node->left);
    printf(" %d",node->key);
    print_tree_inorder(node->right);
}

// 先行順巡回
void print_tree_preorder(NODE *node){
    if(node==NULL) return;
    printf(" %d",node->key);
    print_tree_preorder(node->left);
    print_tree_preorder(node->right);
}

//////////////////////
//ノード用RAM管理

//新規ノード作成
NODE *make_node(int key){
    NODE *node = &node_pool[node_cnt];
    node_cnt++;
    node->key   = key;
    node->right = NULL;
    node->left  = NULL;
    return node;
}




Compiler output:
main.c: In function 'insert_tree':
main.c:80:17: error: incompatible types when assigning to type 'NODE' {aka 'struct _NODE'} from type 'NODE *' {aka 'struct _NODE *'}
   80 |         *root = z;
      |                 ^
Language: C

#include"iostream"
#include"vector"
using namespace std;
class branch
{
public:
  int key;
  branch *p;
  branch *left,*right;
  branch(){}
  branch(int key,branch *p)
  {
    this->key=key;
    this->p=p;
    this->left=NULL;
    this->right=NULL;
  }
};
branch *tree;
void insert(int z)
{
  branch *buf;
  branch *y=NULL;
  branch *x=tree;
  while(x!=NULL)
    {
      y=x;
      if(z<x->key)
        {
          x=x->left;
        }
      else
        {
          x=x->right;
        }
    }
  buf=new branch(z,y);
  if(y==NULL)tree=buf;
  else if(buf->key<y->key)y->left=buf;
  else y->right=buf;
}
int preParse(branch *p)
{
  if(p==NULL)
    {
      return 0;
    }
  cout<<" "<<p->key;
  preParse(p->left);
  preParse(p->right);
}
int inParse(branch *p)
{
  if(p==NULL)
    {
      return 0;
    }
  inParse(p->left);
  cout<<" "<<p->key;
  inParse(p->right);
}
int postParse(branch *p)
{
  if(p==NULL)
    {
      return 0;
    }
  postParse(p->left);
  postParse(p->right);
  cout<<" "<<p->key;
}
int main()
{
  tree=NULL;
  int m;
  char cmd[20];
  cin>>m;
  for(int i=0;i<m;i++)
    {
      cin>>cmd;
      if(cmd[0]=='i')
        {
          int n;
          cin>>n;
          insert(n);
        }
      else if(cmd[0]=='p')
        {
          inParse(tree);
          cout<<endl;
          preParse(tree);
          cout<<endl;
        }
    }
  return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include"iostream"
      |         ^~~~~~~~~~
compilation terminated.
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 ro;

Node treeMi(Node a){
  while(a->left!=NIL)
    a=a->left;
  return a;
}

Node treeMa(Node a){
  while(a->right!=NIL){
    a=a->right;
  }
  return a;
}

Node treeS(Node w, int r){
  while(w!=N&&r!=w->key){
    if(r<w->key)w=w->left;
    else w=w->right;
  }
  return w;
}

Node treeM(Node a){
  Node b;
  if(a->right!=NIL)
    return treeMi(a->right);
  b=a->parent;
  while(b!=NIL&&a==b->right){
    a=b;
    b=b->parent;
  }
  return b;
}

void treeN(Node c){
  Node a;
  Node b;
  if(c->left==NIL||c->right==NIL)
    b=c;
  else
    b=treeM(c);

  if(b->left!=NIL){
    a=b->left;
  }
  else{
    a=b->right;
  }
  if(a!=NIL){
    a->parent=b->parent;
  }
  if(b->parent==NIL){
    ro=a;
  }
  else{
    if(b==b->parent->left){
      b->parent->left=a;
    }
    else{
      b->parent->right=a;
    }
  }
  if(b!=c){
    c->key=b->key;
  }
  free(b);
}

void insert(int k){
  Node a = ro;
  Node b;
  Node c;

  c = malloc(sizeof(struct node));
  c->key = k;
  c->left = NIL;
  c->right = NIL;

  while(a!=NIL){
    b=a;
    if(c->key < a->key){
      a=a->left;
    }
    else{
      a=a->right;
    }
  }
  c->parent=b;
  if(b==NIL){
    ro=c;
  }
  else{
    if(c->key < b->key){
      b->left=c;
    }
    else{
      b->right=c;
    }
  }
}

void inorder(Node n){
  if(n==NIL)
    return;
  inorder(n->left);
  printf(" %d",n->key);
  inorder(n->right);
}

void outorder(Node n){
  if(n==N)
    return;
  printf(" %d",n->key);
  outorder(n->left);
  outorder(n->right);
}

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

  for(i=0;i<n;i++){
    scanf("%s",c);
    if(c[0]=='f'){
      scanf("%d",&a);
      Node r = treeS(ro,a);
      if(r!=N)
	printf("yes\n");
      else printf("no\n");
    }
    else if(c[0] ==  'i'){
      scanf("%d",&a);
      insert(a);
    }
    else if(c[0] ==  'p'){
      inorder(ro);
      printf("\n");
      outorder(ro);
      printf("\n");
    }
    else if(c[0]=='d'){
      scanf("%d",&a);
      treeN(treeS(ro,a));
    }
  }
  return 0;
}



Compiler output:
main.c: In function 'treeS':
main.c:30:12: error: 'N' undeclared (first use in this function)
   30 |   while(w!=N&&r!=w->key){
      |            ^
main.c:30:12: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'outorder':
main.c:125:9: error: 'N' undeclared (first use in this function)
  125 |   if(n==N)
      |         ^
main.c: In function 'main':
main.c:142:13: error: 'N' undeclared (first use in this function)
  142 |       if(r!=N)
      |             ^
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 ro;

Node treeMi(Node a){
  while(a->left!=NIL)
    a=a->left;
  return a;
}

Node treeMa(Node a){
  while(a->right!=NIL){
    a=a->right;
  }
  return a;
}

Node treeS(Node w, int r){
  while(w!=N&&r!=w->key){
    if(r<w->key)w=w->left;
    else w=w->right;
  }
  return w;
}

Node treeM(Node a){
  Node b;
  if(a->right!=NIL)
    return treeMi(a->right);
  b=a->parent;
  while(b!=NIL&&a==b->right){
    a=b;
    b=b->parent;
  }
  return b;
}

void treeN(Node c){
  Node a;
  Node b;
  if(c->left==NIL||c->right==NIL)
    b=c;
  else
    b=treeM(c);

  if(b->left!=NIL){
    a=b->left;
  }
  else{
    a=b->right;
  }
  if(a!=NIL){
    a->parent=b->parent;
  }
  if(b->parent==NIL){
    ro=a;
  }
  else{
    if(b==b->parent->left){
      b->parent->left=a;
    }
    else{
      b->parent->right=a;
    }
  }
  if(b!=c){
    c->key=b->key;
  }
  free(b);
}

void insert(int k){
  Node a = ro;
  Node b;
  Node c;

  c = malloc(sizeof(struct node));
  c->key = k;
  c->left = NIL;
  c->right = NIL;

  while(a!=NIL){
    b=a;
    if(c->key < a->key){
      a=a->left;
    }
    else{
      a=a->right;
    }
  }
  c->parent=b;
  if(b==NIL){
    ro=c;
  }
  else{
    if(c->key < b->key){
      b->left=c;
    }
    else{
      b->right=c;
    }
  }
}

void inorder(Node n){
  if(n==NIL)
    return;
  inorder(n->left);
  printf(" %d",n->key);
  inorder(n->right);
}

void outorder(Node n){
  if(n==N)
    return;
  printf(" %d",n->key);
  outorder(n->left);
  outorder(n->right);
}

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

  for(i=0;i<n;i++){
    scanf("%s",c);
    if(c[0]=='f'){
      scanf("%d",&a);
      Node r = treeS(ro,a);
      if(r!=NIL)
	printf("yes\n");
      else printf("no\n");
    }
    else if(c[0] ==  'i'){
      scanf("%d",&a);
      insert(a);
    }
    else if(c[0] ==  'p'){
      inorder(ro);
      printf("\n");
      outorder(ro);
      printf("\n");
    }
    else if(c[0]=='d'){
      scanf("%d",&a);
      treeN(treeS(ro,a));
    }
  }
  return 0;
}



Compiler output:
main.c: In function 'treeS':
main.c:30:12: error: 'N' undeclared (first use in this function)
   30 |   while(w!=N&&r!=w->key){
      |            ^
main.c:30:12: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'outorder':
main.c:125:9: error: 'N' undeclared (first use in this function)
  125 |   if(n==N)
      |         ^
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 treeMi(Node a){
  while(a->left!=NIL)
    a=a->left;
  return a;
}

Node treeMa(Node a){
  while(a->right!=NIL){
    a=a->right;
  }
  return a;
}

Node treeS(Node w, int r){
  while(w!=N&&r!=w->key){
    if(r<w->key)w=w->left;
    else w=w->right;
  }
  return w;
}

Node treeM(Node a){
  Node b;
  if(a->right!=NIL)
    return treeMi(a->right);
  b=a->parent;
  while(b!=NIL&&a==b->right){
    a=b;
    b=b->parent;
  }
  return b;
}

void treeN(Node c){
  Node a;
  Node b;
  if(c->left==NIL||c->right==NIL)
    b=c;
  else
    b=treeM(c);

  if(b->left!=NIL){
    a=b->left;
  }
  else{
    a=b->right;
  }
  if(a!=NIL){
    a->parent=b->parent;
  }
  if(b->parent==NIL){
    root=a;
  }
  else{
    if(b==b->parent->left){
      b->parent->left=a;
    }
    else{
      b->parent->right=a;
    }
  }
  if(b!=c){
    c->key=b->key;
  }
  free(b);
}

void insert(int k){
  Node a = ro;
  Node b;
  Node c;

  c = malloc(sizeof(struct node));
  c->key = k;
  c->left = NIL;
  c->right = NIL;

  while(a!=NIL){
    b=a;
    if(c->key < a->key){
      a=a->left;
    }
    else{
      a=a->right;
    }
  }
  c->parent=b;
  if(b==NIL){
    root=c;
  }
  else{
    if(c->key < b->key){
      b->left=c;
    }
    else{
      b->right=c;
    }
  }
}

void inorder(Node n){
  if(n==NIL)
    return;
  inorder(n->left);
  printf(" %d",n->key);
  inorder(n->right);
}

void outorder(Node n){
  if(n==N)
    return;
  printf(" %d",n->key);
  outorder(n->left);
  outorder(n->right);
}

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

  for(i=0;i<n;i++){
    scanf("%s",c);
    if(c[0]=='f'){
      scanf("%d",&a);
      Node r = treeS(ro,a);
      if(r!=NIL)
	printf("yes\n");
      else printf("no\n");
    }
    else if(c[0] ==  'i'){
      scanf("%d",&a);
      insert(a);
    }
    else if(c[0] ==  'p'){
      inorder(root);
      printf("\n");
      outorder(root);
      printf("\n");
    }
    else if(c[0]=='d'){
      scanf("%d",&a);
      treeN(treeS(root,a));
    }
  }
  return 0;
}



Compiler output:
main.c: In function 'treeS':
main.c:30:12: error: 'N' undeclared (first use in this function)
   30 |   while(w!=N&&r!=w->key){
      |            ^
main.c:30:12: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insert':
main.c:84:12: error: 'ro' undeclared (first use in this function)
   84 |   Node a = ro;
      |            ^~
main.c: In function 'outorder':
main.c:125:9: error: 'N' undeclared (first use in this function)
  125 |   if(n==N)
      |         ^
main.c: In function 'main':
main.c:141:22: error: 'ro' undeclared (first use in this function); did you mean 'r'?
  141 |       Node r = treeS(ro,a);
      |                      ^~
      |                      r
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;

void insert(int);
void preorder(Node);
void inorder(Node);

#define NIL NULL

Node root;

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

void preorder(Node u){
    if(u == NIL) return;
    printf(" %d", u->key);
preorder(u.left);
preorder(u->right);
}


int main(){
  int n, i, x;
  scanf("%d", &n);
  for ( i = 0; i < n-1; i++ ){
      scanf("%d", &x);
      insert(x);
         if(x == '\n') continue;
  }
      inorder(root);
      printf(" \n");
      preorder(root);
      printf("\n");

  return 0;
}





Compiler output:
main.c: In function 'preorder':
main.c:57:11: error: 'u' is a pointer; did you mean to use '->'?
   57 | preorder(u.left);
      |           ^
      |           ->
Language: C

#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;

struct Node{
  int key;
  Node *right, *left, *parent;
};

Node *root, *NIL;

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

  z = (Node *)malloc(sizeof(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->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) return;
  inorder(u->left);
  printf(" %d", u->key);
  inorder(u->right);
}
void preorder(Node *u){
  if(u == NIL) return;
  printf(" %d", u->key);
  preorder(u->left);
  preorder(u->right);
}

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

  scanf("%d", &n);

  for(i=0; i<n; i++){
    cin >> com;

    if(com == "insert"){
      scanf("%d", &x);
      insert(x);
    } else if(com == "print"){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}


Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<>

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){


}

Node treeMaximum(Node x){


}

Node treeSearch(Node u, int k){


}

Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}

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;




}

void inorder(Node u){

}
void preorder(Node u){

}


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:2:9: error: empty filename in #include
    2 | #include<>
      |         ^~
main.c: In function 'insert':
main.c:48:7: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   48 |   z = malloc(sizeof(struct node));
      |       ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | #include<>
main.c:48:7: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   48 |   z = malloc(sizeof(struct node));
      |       ^~~~~~
main.c:48:7: note: include '<stdlib.h>' or provide a declaration of 'malloc'
Language: C

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

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

void Insert(int);
void Preorder(Node);
void Inoder(Node);

int main(){

  int n,i,key;
  char S[7];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",S);
    if(S[0]=='i'){
      scanf("%d",&key);
      Insert(key);
    }
    else{
      Inoder(T);
      printf("\n");
      Preorder(T);
      printf("\n");
    }
  }
  return 0;
}
void Insert(int key){
  Node x,y,z;
  y=NIL;
  x=T;
  z=malloc(sizeof(struct node));
  z->key=key;
  z->left=NIL;
  z->right=NIL;
  while(x!=NULL){
    y=x;
    if(z->key < x->key ){
      x=x->left;}
      else{
        x=x->right;
      }
    }
      z->parent=y;
      if(y==NULL){
        T=z;
      }
      else if(z->key<y->key){
        y->left=z;
      }
      else{
        y->right=z;
      }
    }
    void Inorder(Node T){
      if(T->left!=NULL && T->right!=NULL){
        Inorder(T->left);
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left!=NULL && T->right==NULL){
        Inorder(T->left);
        printf(" %d",T->key);
      }
      if(T->left==NULL && T->right!=NULL){
        printf(" %d",T->key);
        Inorder(T->right);
      }
      if(T->left==NULL && T->right==NULL){

        printf(" %d",T->key);

      }





    }



Compiler output:
/usr/bin/ld: /tmp/cc0kNpTO.o: in function `main':
main.c:(.text+0x84): undefined reference to `Inoder'
/usr/bin/ld: main.c:(.text+0x9d): undefined reference to `Preorder'
collect2: error: ld returned 1 exit status
Language: C

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



struct node{
    int me;
    struct node *parent;
    struct node *left;
    struct node *right;
    
};
 struct node *Tree,*END;
int number;

void input(void){
    char str[100];
    int n;
    int i;
    scanf("%d",&number);
    for(i=0;i<number;i++){
        scanf("%s",str);
        if(strcmp(str,"insert")){
            scanf("%d",&n);
        insert(n);
        }
        else if(strcmp(str,"print")==1){
            Inorder(Tree);
            printf("\n");
            Preorder(Tree);
            printf("\n");
        }
    }
    
    
}

void insert(int n){
    struct node *a=Tree;
    struct node *b=END;
    struct node *c;
    
    c->me=n;
    c->left=END;
    c->right=END;
    
    
    while(b!=END){
        b=a;
        if(c->me < a->me){
            a=a->left;
                    }else {
                        a=a->right;
                    }
                    
                    
    }
    
    c->parent=b;
    if(b==END){
        Tree=c;
        
    }else{
        if(c->me < b-> me){
            b->left=c;
            
            
        }else{
            b->right=c;
        }
        
    }
    
    
    
}

void inorder(struct node *a){
    if(a==END)return;
    inorder(a->left);
    printf("%d",a->me);
    inorder(a->right);
    
    
}

void preorder(struct node *a){
    if(a==END)return;
    printf("%d",a->me);
    preorder(a->left);
    preorder(a->right);
    
}


int main(void) {
    
    input();    
	return 0;
	
}




Compiler output:
main.c: In function 'input':
main.c:25:9: error: implicit declaration of function 'insert' [-Wimplicit-function-declaration]
   25 |         insert(n);
      |         ^~~~~~
main.c:28:13: error: implicit declaration of function 'Inorder' [-Wimplicit-function-declaration]
   28 |             Inorder(Tree);
      |             ^~~~~~~
main.c:30:13: error: implicit declaration of function 'Preorder' [-Wimplicit-function-declaration]
   30 |             Preorder(Tree);
      |             ^~~~~~~~
main.c: At top level:
main.c:38:6: warning: conflicting types for 'insert'; have 'void(int)'
   38 | void insert(int n){
      |      ^~~~~~
main.c:25:9: note: previous implicit declaration of 'insert' with type 'void(int)'
   25 |         insert(n);
      |         ^~~~~~
Language: C

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



struct node{
    int me;
    struct node *parent;
    struct node *left;
    struct node *right;
    
};
 struct node *Tree,*END;
int number;

void input(void);
void insert(int n);
void inorder(struct node *a);
void preorder(struct node *a);

void input(void){
    char str[100];
    int n;
    int i;
    scanf("%d",&number);
    for(i=0;i<number;i++){
        scanf("%s",str);
        if(strcmp(str,"insert")){
            scanf("%d",&n);
        insert(n);
        }
        else if(strcmp(str,"print")==1){
            Inorder(Tree);
            printf("\n");
            Preorder(Tree);
            printf("\n");
        }
    }
    
    
}

void insert(int n){
    struct node *a=Tree;
    struct node *b=END;
    struct node *c;
    
    c->me=n;
    c->left=END;
    c->right=END;
    
    
    while(b!=END){
        b=a;
        if(c->me < a->me){
            a=a->left;
                    }else {
                        a=a->right;
                    }
                    
                    
    }
    
    c->parent=b;
    if(b==END){
        Tree=c;
        
    }else{
        if(c->me < b-> me){
            b->left=c;
            
            
        }else{
            b->right=c;
        }
        
    }
    
    
    
}

void inorder(struct node *a){
    if(a==END)return;
    inorder(a->left);
    printf("%d",a->me);
    inorder(a->right);
    
    
}

void preorder(struct node *a){
    if(a==END)return;
    printf("%d",a->me);
    preorder(a->left);
    preorder(a->right);
    
}


int main(void) {
    
    input();    
	return 0;
	
}




Compiler output:
main.c: In function 'input':
main.c:33:13: error: implicit declaration of function 'Inorder'; did you mean 'inorder'? [-Wimplicit-function-declaration]
   33 |             Inorder(Tree);
      |             ^~~~~~~
      |             inorder
main.c:35:13: error: implicit declaration of function 'Preorder'; did you mean 'preorder'? [-Wimplicit-function-declaration]
   35 |             Preorder(Tree);
      |             ^~~~~~~~
      |             preorder