public void visit(TreeNode node, int depth){
    	depth++;
    	if(node.left == null && node.right == null){
    		if(depth < min) min = depth;
    	}
    	if(node.left != null) visit(node.left, depth);
    	if(node.right != null) visit(node.right, depth);
    }