C#

void deleteNode(node *root,node* parent) { node *temp; if(root->left==NULL)/*Only left child*/ { if(parent->left==root) parent->left=root->right; else parent->right==root->right; free(root); } else if(root->right==NULL)/*Only right child*/ { if(parent->left==root) parent->left=root->left; else parent->right=root->left; free(root); } else/*Both children exist*/ { temp=root->left; while(temp->right!=NULL) temp=temp->right; root->info=temp->info; deleteItem(root->left,root,temp->info); free(root); } }Do you

*want "==" in there? :laugh:*

**really**C++

parent->right==root->right;

We've all done it! :O