#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    struct node *left,*right;
}
struct node*newnode(intvalue)
{
    struct node*temp=(struct node*)malloc(sizeof(struct node));
    temp->data=value;
    temp->left=temp->right=NULL;
    return temp;
}
struct node*insert(struct node*root,int value){
    if(root==NULL)
    root->left=insert(root->left,value);
    else if(value>root->data)
    root->right=insert(root->right,value);
    return root;
}
void inorder(struct node*root){
    if(root!=NULL)
    inorder(root->left);
    printf("%d,root->data");
    inorder(root=>right);
}
int main(){
    struct node*root=NULL;
    int n,value,i;
    printf("enter no of nodes:");
    scanf("%d",&n);
    printf("enter %d values:\n",n);
    for(i=0;i<n;i++){
        scanf("%d",&value);
        root=insert(root,value);
    }
    printf("\n inorder traversal(sorted order):");
    inorder(root);
    return 0;
}