We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15fb7ac commit 39bdb61Copy full SHA for 39bdb61
maximum-depth-of-binary-tree/s0ooo0k.java
@@ -0,0 +1,10 @@
1
+class Solution {
2
+ /*
3
+ * 시간복잡도: O(n)
4
+ */
5
+ public int maxDepth(TreeNode root) {
6
+ if(root==null) return 0;
7
+ return 1+Math.max(maxDepth(root.left), maxDepth(root.right));
8
+ }
9
+}
10
+
0 commit comments