(self, pRoot)
| 31 | return False |
| 32 | |
| 33 | def preOrder(self, pRoot): |
| 34 | if pRoot == None: |
| 35 | return [None] |
| 36 | treeStack = [] |
| 37 | output = [] |
| 38 | pNode = pRoot |
| 39 | while pNode or len(treeStack) > 0: |
| 40 | while pNode: |
| 41 | treeStack.append(pNode) |
| 42 | output.append(pNode.val) |
| 43 | pNode = pNode.left |
| 44 | if not pNode: |
| 45 | output.append(None) |
| 46 | if len(treeStack): |
| 47 | pNode = treeStack.pop() |
| 48 | pNode = pNode.right |
| 49 | if not pNode: |
| 50 | output.append(None) |
| 51 | return output |
| 52 | |
| 53 | def mirrorPreOrder(self, pRoot): |
| 54 | if pRoot == None: |