(self, root)
| 35 | |
| 36 | #iterative(BFS) |
| 37 | def isSymmetric2(self, root): |
| 38 | if root: |
| 39 | now = [root] |
| 40 | while now: |
| 41 | vals = [i.val if i else None for i in now] |
| 42 | if list(reversed(vals)) != vals: |
| 43 | return False |
| 44 | else: |
| 45 | now = [j for i in now if i for j in (i.left, i.right)] |
| 46 | return True |
| 47 | # modify iterative(BFS) |
| 48 | def isSymmetric_2(self, root): |
| 49 | if root: |
nothing calls this directly
no outgoing calls
no test coverage detected