public class Solution {
/**
*
* @param root TreeNode类
* @return int整型
*/
public int run (TreeNode root) {
// write code here
if(root == null) return 0;
return my(root,0);
}
public int my(TreeNode root, int count){
if(root == null) return count;
count++;
if(root.left==null&&root.right==null) return count;
else if (root.left==null) return my(root.right,count);
else if (root.right==null) return my(root.left,count);
else return Math.min(my(root.left,count),my(root.right,count));
}
}