To remove a leaf you cant just delete the leaf node, you must also remove the link from the parent to that leaf. In the case that there is only 1 node in the tree, removing the leaf is also removing the root, so this is also a special case. Instead of using find, your remove should be something similar to find at first, but you need to also keep track of the parent node as you go so you can delete the child link to the leaf.
its like removing from a singly linked list, just keep track of where you came from except your going to need to know if your a left/right child
your find function is going to work for you as is you have two choices really,
modify the find functions to give you back additional information or just do the traversal inside the remove method itself keeping track of parent/ isleft or isright child
Removing a node from a BST is not so simple. As it were said, you should remove a link from the parent and, therefore, in find() you should track the parent. See more detailed description along with a source code here: http://simpleprogrammingtutorials.com/tutorials/bst-remove.php
You can just go to that leaf
1) take a previous and current pointer and then when you reach the leaf which will be the current at that time ,you can store its value ( if you need that one ).
2)Now point the previous to NULL so that now the node will be deleated ...
in C++ we can use the "free();"to remove the node you want do it.
+find the node you want delete;
+add the template val the remember that node;
+remove all the cornect tor to it. form his father node,
+if you want delete that node ,that must be the left(n) what is it???
uhm that is the node which has no the son node.
+then you can delete template val== node want be remove.
THAT RIGHT????????????