Example: 4 / \ 2 8 / \ 5 10 Output ==> 2
1. If the root
node is null
, return null
.
2. Else, if the left node of the root
node is null
, return root
3. Recurse through the left
node. i.e. return findMin(root.left)
public TreeNode findMin(TreeNode root) { }
C
Java
Python