this code was perfectly working when i was using integers now i want to insert strings so i changed the comparisons to strcomp and its not woorking any help appreciated link for the full code http://pastebin.com/6j1haZRF
struct node * insert(struct node *root, char x[])
{
if(!root)
{
root=(struct node*)malloc(sizeof(struct node));
root->data = x;
root->left = NULL;
root->right = NULL;
return(root);
}
if((a=strcmp(root->data,x))>0){
root->left = insert(root->left,x);
}
else
{
if(strcmp(root->data,x)<0)
root->right = insert(root->right,x);
}
return(root);
}