public static void dfsBtree(TreeNode p, int depth) {
        if (p.left == null && p.right == null) {
            if (depth < min) {
                min = depth;
            }
        } else {
            if (p.left != null) {
                dfsBtree(p.left, depth + 1);
            }

            if (p.right != null) {
                dfsBtree(p.right, depth + 1);
            }
        }
    }