Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 58ee41f

Browse files
Coding SOlution of symmetric tree
1 parent 2925c84 commit 58ee41f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎coding_solutions/DataStructure_related/Tree/CheckSymmetryTree.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
'''
2+
Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
3+
4+
5+
'''
6+
7+
18
# Definition for a binary tree node.
29
# class TreeNode:
310
# def __init__(self, val=0, left=None, right=None):
411
# self.val = val
512
# self.left = left
613
# self.right = right
14+
715
class Solution:
816
def isSymmetric(self, root: Optional[TreeNode]) -> bool:
917
def isMirror(root1, root2):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /