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.
2 parents aa44e4b + b7ad44a commit f53a921Copy full SHA for f53a921
maximum-depth-of-binary-tree/kimjunyoung90.java
@@ -0,0 +1,6 @@
1
+public class Solution {
2
+ public int maxDepth(TreeNode root) {
3
+ if (root == null) return 0;
4
+ return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
5
+ }
6
+}
merge-two-sorted-lists/kimjunyoung90.java
@@ -0,0 +1,17 @@
+ public ListNode mergeTwoLists(ListNode list1, ListNode list2) {
+ //1. null 체크
+ if(list1 == null || list2 == null) {
+ return list1 != null ? list1 : list2;
7
+ //1. 값 비교
8
+ if(list1.val < list2.val) {
9
+ //다음 Node 비교
10
+ list1.next = mergeTwoLists(list1.next, list2);
11
+ return list1;
12
+ } else {
13
+ list2.next = mergeTwoLists(list1, list2.next);
14
+ return list2;
15
16
17
0 commit comments