binary trees infixa*( +cprefix* +bc postfixabc+figure tree representing an algebraic expression for examplethe binary tree shown in figure represents the algebraic expression *( +cthis is called infix notationit' the notation normally used in algebra (for more on infix and postfixsee the section "parsing arithmetic expressionsin "stacks and queues "traversing the tree inorder will generate the correct inorder sequence * +cbut you'll need to insert the parentheses yourself what does all this have to do with preorder and postorder traversalslet' see what' involved for these other traversals the same three steps are used as for inorderbut in different sequence here' the sequence for preorder(method visit the node call itself to traverse the node' left subtree call itself to traverse the node' right subtree traversing the tree shown in figure using preorder would generate the expression * +bc this is called prefix notation one of the nice things about it is that parentheses are never requiredthe expression is unambiguous without them starting on the lefteach operator is applied to the next two things in the expression for the first operator*these two things are and +bc for the second operator+the two things are and cso this last expression is + in inorder notation inserting that into the original expression * +bc (preordergives us *( +cin inorder by using different traversals of the treewe can transform one form of the algebraic expression into another