#include<stdio.h>
#include<>stdlib.h>
struct node
{
    struct node* left;
    struct node* right;
    int data;
};
struct node* createnode(int val)
{
    struct node* newnode=(struct node*)malloc(sizeof(struct node));
    newnode->data=val;
    newnode->left=newnode->right=NULL;
    return newnode;
}
struct node* insert(struct node* root,int val)
{
    if(root==NULL)
    {
        return createnode(val);
    }
    if(val<root->data)
    {
        root->left=insert(root->left,val);
    }
    else if(val>root->right)
    {
        root->right=insert(root->right,val);
    }
    return root;
}
struct node* min(struct node* root)
{
    while(root->left!=NULL)
    {
        root=root->left;
    }
    return root;
}