MCPcopy
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / postorder

Function postorder

ParseTree.py:51–55  ·  view source on GitHub ↗
(tree)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

getLeftChildMethod · 0.80
getRightChildMethod · 0.80
getRootValMethod · 0.80

Tested by

no test coverage detected