Process all nodes of a tree by recursively processing all subtrees, then finally processing the root.