Top view Of Binary search tree

/*
struct node
{
    int data;
    node* left;
    node* right;
};

*/
void inorder(node * root)
    {
    if(root!=NULL)
        {
        inorder(root->left);
        printf("%d ",root->data);
    }
}
void inorder1(node * root)
    {

    if(root!=NULL)
        {
        printf("%d ",root->data);
        inorder1(root->right);
       
    }
}
void top_view(node * root)
{

 inorder(root->left);
   printf("%d ",root->data);
    inorder1(root->right);
}

Comments

Popular posts from this blog

How whatsapp works

Android N Developer Preview? It's exciting for most of you