post-order traversal

Visiting a node's left subtree, then its right subtree, and the node itself last.

In more detail

Children are always handled before their parent, which is what you need to evaluate an expression tree, total up sizes of folders, or free a tree's memory. Like the other recursive traversals it takes O(n) time and O(h) stack space.

Related terms

Taught in

References