(self)
| 35 | # 树的前序遍历 |
| 36 | # 树的后序遍历以及中序遍历见ParseTree.py |
| 37 | def preorder(self): |
| 38 | print(self.key) |
| 39 | if self.leftChild: |
| 40 | self.leftChild.preorder() |
| 41 | if self.rightChild: |
| 42 | self.rightChild.preorder() |
| 43 | |
| 44 | ''' |
| 45 | 以下为测试数据, 去掉 # 即可 |
nothing calls this directly
no outgoing calls
no test coverage detected