Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 6월 첼린지
- two sum
- 알고리즘
- 른당사피
- 알탕뚝배기
- java
- map
- 해물감성포차
- algorithum
- 망원 밥집
- 사당돈
- Python
- linked list
- prefix sum
- Array
- algorithm
- LeetCode
- invert Binary Tree
- 발리 음식
- 발리인망원
- 코딩 테세트
- Find the Duplicate Number
- 투포인터
- string
- 맛집
- findDulicate
- 코딩 테스트
- two pointers
- tree
- 코테
Archives
- Today
- Total
기록하는 공간
[leetcode/java] 226. Invert Binary Tree 본문
class Solution {
public TreeNode invertTree(TreeNode root) {
if (root == null) return root;
TreeNode node = root.left;
root.left = root.right;
root.right = node;
invertTree(root.left);
invertTree(root.right);
return root;
}
}
'알고리즘 > leetcode' 카테고리의 다른 글
[leetcode/kotlin] 392.Is Subsequence (0) | 2020.06.09 |
---|---|
[leetcode/kotlin] 344. Reverse String (0) | 2020.06.04 |
[leetcode/java] 367. Valid Perfect Square (0) | 2020.05.09 |
[leetcode/java] 1427.Perform String Shifts (0) | 2020.04.15 |
[leetcode/java] 287. Find the Duplicate Number (0) | 2020.04.11 |
Comments