MCPcopy Create free account
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / isSymmetric

Method isSymmetric

leetcode/101. Symmetric Tree.py:27–28  ·  view source on GitHub ↗
(self, root)

Source from the content-addressed store, hash-verified

25class Solution(object):
26 # recursive
27 def isSymmetric(self, root):
28 return self._Symmetrical(root, root)
29 def _Symmetrical(self, pRoot1, pRoot2):
30 if pRoot1 and pRoot2:
31 return pRoot1.val == pRoot2.val and self._Symmetrical(pRoot1.left, pRoot2.right) and self._Symmetrical(

Callers

nothing calls this directly

Calls 1

_SymmetricalMethod · 0.95

Tested by

no test coverage detected