Preorder traversal:
Let T be an ordered rooted tree with root r. If T consists only of r, then r is the preorder traversal of T. Otherwise, suppose that\({T_1},{T_2},...,{T_n}\)are the subtrees at r from left to right in T. The preorder traversal begins by visiting r. It continues by traversing\({T_1},\)in preorder, then\({T_2}\)in preorder, and so on, until\({T_n}\)is traversed in preorder.
Postorder traversal:
Let T be an ordered rooted tree with root r. If T consists only of r, then r is the postorder traversal of T. Otherwise, suppose that\({T_1},{T_2},...,{T_n}\)are the subtrees at r from left to right. The postorder traversal begins by traversing\({T_1},\)in postorder, then\({T_2}\)in postorder, …, then\({T_n}\)in postorder, and ends by visiting r.
Inorder traversal:
Let T be an ordered rooted tree with root r. If Tconsists only of r, then r is the inorder traversal of T. Otherwise, suppose that\({T_1},{T_2},...,{T_n}\)are the subtrees at r from left to right. The inorder traversal begins by traversing\({T_1},\)in inorder, then visiting r. It continues by traversing\({T_2}\)in inorder, and so on, until\({T_n}\)is traversed in inorder.
Note: Since the prefix, postfix and infix form of this expression are founded by traversing this rooted tree in preorder, post order and inorder (including parentheses), respectively.