(tree)
| 49 | |
| 50 | # 递归实现树的后序遍历 |
| 51 | def postorder(tree): |
| 52 | if tree != None: |
| 53 | postorder(tree.getLeftChild()) |
| 54 | postorder(tree.getRightChild()) |
| 55 | print(tree.getRootVal()) |
| 56 | |
| 57 | # 利用后序遍历实现两个叶结点的运算 |
| 58 | def postordereval(tree): |
nothing calls this directly
no test coverage detected