Definition Tree node (node): contains a data element and several branches pointing to the subtree;
Child node: node The root of the subtree of a point is called the child of the node;
P
Definition Tree node (node): contains a data element and several branches pointing to the subtree;
Child node: node The root of the subtree of a point is called the child of the node;
P
1.Minimum Depth of Binary Tree // Recursive version, time complexity O( n), space complexity O(logn)
private static int minDepth(TreeNode root) {
if (root == null) return 0;
return Math.min(minDe