How can I keep the depth property of a binary search tree's node updated after something is deleted?
I'm thinking that for the case where I delete a node with one child, then I can set the depth of every node under the parent of the node deleted to (original depth - 1).
However, I can not think of a good way to keep depth updated when I am deleting a node that had two children.
For the case of deleting a node with two children, my delete method either moves the left-most node in the right subtree, or the right-most node in the left subtree, up to the node that I am deleting, depending on which path is shorter.
I am not looking for code, just a general game plan or pseudo code