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 | 
                            Tags
                            
                        
                          
                          - 리버싱
- #abex크랙미4번
- java8
- #크랙미 5번
- #abex
- #파밍
- GraphQL
- #크랙미4번
- #abex크랙미
- Spring
- springframework
- #보안이슈
- #크랙미3번
- java
- #크랙미 9번
- #크랙미 10번
- Easy
- #심플즈
- #크랙미2번
- #고클린
- #리버싱
- leetcode
- #보안뉴스
- #심플즈 크랙미
- #크랙미
                            Archives
                            
                        
                          
                          - Today
- Total
Halo World
[LeetCode] 101. Symmetric Tree 본문
https://leetcode.com/problems/symmetric-tree/
class Solution {
    public boolean isSymmetric(TreeNode root) {
        return isMirror(root.right, root.left);
    }
    
    private boolean isMirror(TreeNode n1, TreeNode n2){
        if(n1==null || n2==null) return n1==n2;
        return (n1.val == n2.val && isMirror(n1.left, n2.right) && isMirror(n1.right, n2.left));
    }
}'스터디 > 알고리즘 문제풀이' 카테고리의 다른 글
| [LeetCode] 617. Merge Two Binary Trees (0) | 2021.10.05 | 
|---|---|
| [LeetCode] 696. Count Binary Substrings (0) | 2021.10.04 | 
| [LeetCode] 226. Invert Binary Tree (0) | 2021.10.04 | 
| [LeetCode] 543. Diameter of Binary Tree (0) | 2021.09.30 | 
| [문제풀이] 백준 14499 주사위 (2) | 2017.10.18 |