Tree: Postorder Traversal

  • + 0 comments
    def postOrder(root):
        result = []
        
        def traverse(node):
            if not node:
                return
            traverse(node.left)
            traverse(node.right)
            result.append(str(node.info))
            
        traverse(root)
        print(" ".join(result))