diff --git a/problems/0111.二叉树的最小深度.md b/problems/0111.二叉树的最小深度.md index 0137bd15..6378300c 100644 --- a/problems/0111.二叉树的最小深度.md +++ b/problems/0111.二叉树的最小深度.md @@ -372,7 +372,7 @@ var minDepth1 = function(root) { // 到叶子节点 返回 1 if(!root.left && !root.right) return 1; // 只有右节点时 递归右节点 - if(!root.left) return 1 + minDepth(root.right);、 + if(!root.left) return 1 + minDepth(root.right); // 只有左节点时 递归左节点 if(!root.right) return 1 + minDepth(root.left); return Math.min(minDepth(root.left), minDepth(root.right)) + 1;