Language: C++

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

struct node {
  int key;
  struct node *right;
  struct node *left;
  struct node *parent;
};
typedef struct node * Node;
Node root;
void Insert(int );
void inorder(Node );
void preorder(Node );
Node search(Node, int);

int main()
{
  int i,j,k;
  char c[10];
  Node a;
  scanf("%d",&k);

  for(i=0;i<k;i++)
    {
      scanf("%s",&c[0]);
      if(c[0]=='f')
        {
          scanf("%d",&j);
          *a=search(root,j);
          if(a!=NIL) printf("yes\n");
          else printf("no");
        }
      if(c[0]=='i')
        {
          scanf("%d",&j);
          Insert(j);
        }
      else if(c[0]=='p')
        {
          inorder(root);
          printf("\n");
          preorder(root);
          printf("\n");
        }
    }
  return 0;
}
void Insert(int p)
{
  Node x=root;
  Node y=NIL;
  Node z;

  z=malloc(sizeof(struct node));
  z->key=p;
  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 x)
{
  if(x==NIL) return;
  inorder(x->left);
  printf(" %d",x->key);
  inorder(x->right);
}

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

Node search(Node *u,int k)
{
  while(u!=NIL && k!=u.key)
    {
      if(k < u->key) u=u->left;
      else u=u->right;
    }
  return u;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: no match for 'operator=' (operand types are 'node' and 'Node' {aka 'node*'})
   31 |           *a=search(root,j);
      |                           ^
a.cc:5:8: note: candidate: 'constexpr node& node::operator=(const node&)'
    5 | struct node {
      |        ^~~~
a.cc:5:8: note:   no known conversion for argument 1 from 'Node' {aka 'node*'} to 'const node&'
a.cc:5:8: note: candidate: 'constexpr node& node::operator=(node&&)'
a.cc:5:8: note:   no known conversion for argument 1 from 'Node' {aka 'node*'} to 'node&&'
a.cc: In function 'void Insert(int)':
a.cc:56:11: error: invalid conversion from 'void*' to 'Node' {aka 'node*'} [-fpermissive]
   56 |   z=malloc(sizeof(struct node));
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |           |
      |           void*
a.cc: In function 'node* search(node**, int)':
a.cc:92:24: error: request for member 'key' in 'u', which is of non-class type 'node**'
   92 |   while(u!=NIL && k!=u.key)
      |                        ^~~
a.cc:94:17: error: request for member 'key' in '* u', which is of pointer type 'Node' {aka 'node*'} (maybe you meant to use '->' ?)
   94 |       if(k < u->key) u=u->left;
      |                 ^~~
a.cc:94:27: error: request for member 'left' in '* u', which is of pointer type 'Node' {aka 'node*'} (maybe you meant to use '->' ?)
   94 |       if(k < u->key) u=u->left;
      |                           ^~~~
a.cc:95:17: error: request for member 'right' in '* u', which is of pointer type 'Node' {aka 'node*'} (maybe you meant to use '->' ?)
   95 |       else u=u->right;
      |                 ^~~~~
a.cc:97:10: error: cannot convert 'node**' to 'Node' {aka 'node*'} in return
   97 |   return u;
      |          ^
      |          |
      |          node**