I was reading on this and in one place it says
The rightmost node will be the node with the greatest value in the left subtree which I assume then that the leftmost is the greatest value in the right subtree.
However, in another article it shows me a different approach to find the leftmost node:
1) If the given node has no right child :
Go to the root of the given node until it is the left child of any node. That node will be the next higher node in the tree.
2) If the given node has right child :
a) If the right child of the given node has no left child
The right child will be the next higher node.
b) If the right child of the given node has left child
The leftmost leaf node will be the next higher node.
i.e 2nd approach doesn't return greatest value as the 1st approach suggests Please clarify..