traverse the left subtree visit the node traverse the right subtree ii jj figure the logical ordering of the nodes with an inorder traversal postorder traversal we can also perform postorder traversal which can be viewed as the opposite of the preorder traversal in postorder traversalthe left and right subtrees of each node are traversed before the node is visited the recursive function is provided in listing listing postorder traversal on binary tree def postordertravsubtree )if subtree is not none postordertravsubtree left postordertravsubtree right printsubtree data the example tree with the logical ordering of the node visits in postorder traversal is shown in figure the nodes are visited in this orderdhebfijgca you may notice that the root node is always visited first in preorder traversal but last in postorder traversal traverse the left subtree traverse the right subtree visit the node ii jj figure the logical ordering of the nodes with postorder traversal