Language: C

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

struct node {

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

typedef struct node* Node;
Node root;

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

void insert(int k) {

????Node y = NULL;
????Node x = root;
????Node z;?? 

????z = malloc(sizeof(struct node));
????z->key = k;
????z->left = NULL;
????z->right = 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 inorder(Node u) {

????if(u->left != NULL)
????????inorder(u->left);
????printf(" %d",u->key);
????if(u->right != NULL)?? 
????????inorder(u->right); 
}

void preorder(Node u) {
????printf(" %d",u->key);
????if(u->left != NULL)
????????preorder(u->left);
????if(u->right != NULL)
????????preorder(u->right); 
}

int main(void) {
??????
????int n,i,x;
????char tree[5];

????scanf("%d",&n);

????for(i=0;i<n;i++) {
????scanf("%s",tree);
????if(c[0] == 'f') {
????????scanf("%d",&x);
????????if(treeSearch(root,x) != NULL){
????????????printf("yes\n");
}
????????else printf("no\n");
????}
????else if(tree[0] == 'i') {
????????scanf("%d",&x);
????????insert(x);
????}
????else if(tree[0] == 'p') {
????????if(root != NULL)???? 
????????????inorder(root);
????????printf("\n");
????????if(root != NULL)
????????????preorder(root);
????????printf("\n");
??}
??}
return 0;
}

Compiler output:
main.c:6:1: error: expected specifier-qualifier-list before '?' token
    6 | ????int key;
      | ^
main.c: In function 'treeSearch':
main.c:16:1: error: expected expression before '?' token
   16 | ????if(x == NULL || k == x-> key)
      | ^
main.c:18:1: error: expected expression before '?' token
   18 | ????if(k < x->key)
      | ^
main.c:20:1: error: expected expression before '?' token
   20 | ????else return treeSearch(x->right,k );
      | ^
main.c: In function 'insert':
main.c:25:1: error: expected expression before '?' token
   25 | ????Node y = NULL;
      | ^
main.c:26:1: error: expected expression before '?' token
   26 | ????Node x = root;
      | ^
main.c:27:1: error: expected expression before '?' token
   27 | ????Node z;??
      | ^
main.c:27:12: error: expected expression before '?' token
   27 | ????Node z;??
      |            ^
main.c:29:5: error: 'z' undeclared (first use in this function)
   29 | ????z = malloc(sizeof(struct node));
      |     ^
main.c:29:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:1: error: expected expression before '?' token
   30 | ????z->key = k;
      | ^
main.c:31:1: error: expected expression before '?' token
   31 | ????z->left = NULL;
      | ^
main.c:32:1: error: expected expression before '?' token
   32 | ????z->right = NULL;
      | ^
main.c:34:1: error: expected expression before '?' token
   34 | ??while(x != NULL) {
      | ^
main.c:43:1: error: expected expression before '?' token
   43 | ????if(y == NULL)
      | ^
main.c:46:1: error: expected expression before '?' token
   46 | ????else if(z->key < y->key)
      | ^
main.c:49:1: error: expected expression before '?' token
   49 | ????else
      | ^
main.c: At top level:
main.c:53:1: error: expected identifier or '(' before '?' token
   53 | ??
      | ^
main.c: In function 'preorder':
main.c:64:1: error: expected expression before '?' token
   64 | ????printf(" %d",u->key);
      | ^
main.c:64:19: error: 'struct node' has no member named 'key'
   64 | ????printf(" %d",u->key);
      |                   ^~
main.c:65:1: error: expected expression before '?' token
   65 | ????if(u->left != NULL)
      | ^
main.c:67:1: error: expected expression before '?' token
   67 | ????if(u->right != NULL)
      | ^
main.c: In function 'main':
main.c:72:1: error: expected expression before '?' token
   72 | ??????
      | ^
main.c:74:1: error: expected expression before '?' token
   74 | ????char tree[5];
      | ^
main.c:76:1: error: expected expression before '?' token
   76 | ????scanf("%d",&n);
      | ^
main.c:76:17: error: 'n' undeclared (first use in this function)
   76 | ????scanf("%d",&n);
      |                 ^
main.c:78:1: error: expected expression before '?' token
   78 | ????for(i=0;i<n;i++) {
      | ^