Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

Visualizer › Trees

Postorder Traversal

Visits both subtrees first and the node last.

How it works

Complexity

Code (Python)

def postorder(node, out):
    if node:
        postorder(node.left, out)
        postorder(node.right, out)
        out.append(node.val)

Practise: Trees problems