void insert(node *n,int x){
if(n==null)
return ;
node *p,*t=n;
node *temp;
temp=(node *)malloc(sizeof(node));
temp->data=x;
temp->right=temp->left=null;
while(t!=null){
p=t;
if(x>t->data)
t=t->right;
else
t=t->left;
}
if(x>p->data)
p->right=temp;
else
p->left=temp;
}
On Sat, Jul 3, 2010 at 4:26 PM, Raj N <[email protected]> wrote:
> Hi,
> Can someone provide me the code to perform insertion in balanced BST
> with proper explanation.
> Thanks !!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>
--
With Regards,
Jalaj Jaiswal
+919026283397
B.TECH IT
IIIT ALLAHABAD
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.