A: 

To start with, your function should have a parameter for the parent, too (unless your tree has pointers to parents, which it sounds like it doesn't).

With that change, it should be easier for you to figure the rest out. But how you call that function becomes important.

Note: I'm assuming this is homework, so I don't want to provide a comprehensive answer.

Also, for the logic of what to do with the nodes after one is removed (how to relink them), try drawing some diagrams.

JoshD
+2  A: 

This sounds like homework. You might find this article on binary tree rotation to be helpful. In addition to give you some hints on how to handle some interesting cases, that article will also show you how you might diagram the problem out for yourself.

Deleting from a tree is an interesting case, and I remember puzzling over it when I wrote my own AVL tree implementation in C in the late 80s.

Omnifarious
Hm, this is a much better answer than mine. I guess it takes all kinds ;)
JoshD
A: 

This wiki page on binary search tree might help.

Donotalo
A: 

In addition to the other answers (and assuming this is homework, the point being to learn), you may find Niklaus Wirth's "Algorithms + Data Structures = Programs" very enlightening, both in general and for your particular problem.

It's a classic little book, a gem.

Hopefully available at your nearest (university?) library?

Cheers & hth.,

Alf P. Steinbach
A: 

When you delete a node,
- If it's a leaf, you're done.
- If it has one child, promote the child and then delete the child from its subtree (by calling yourself).
- If it has two children, pick which one to promote and then delete that child from its subtree (by calling yourself).

Sometimes which of two children you pick depends on factors like
- the root of a subtree is the least of all the nodes in the subtree
- the root of a subtree is the most of all the nodes in the subtree
- some coloring or other side-condition must be conserved

This should get you off high-center.

Eric Towers