Look at your code:
void deleteNode(node *root,node* parent)
{
node *temp;
if(root->left==NULL)
{
if(parent->left==root)
parent->left=root->right;
else
parent->right==root->right;
free(root);
}
else if(root->right==NULL)
{
if(parent->left==root)
parent->left=root->left;
else
parent->right=root->left;
free(root);
}
else
{
temp=root->left;
while(temp->right!=NULL)
temp=temp->right;
root->info=temp->info;
deleteItem(root->left,root,temp->info);
free(root);
}
}
Do you
really want "==" in there? :laugh:
parent->right==root->right;
We've all done it! :O