parentheses before using the result as an operand in any other calculation the closing parenthesis tells us we can go ahead and do the addition we find that + is and once we know thiswe can evaluate * to obtain reaching the end of the expression is an anticlimax because there' nothing left to evaluate the process is shown in figure as we've seenin evaluating an infix arithmetic expressionyou go both forward and backward through the expression you go forward (left to rightreading operands and operators when you have enough information to apply an operatoryou go backwardrecalling two operands and an operator and carrying out the arithmetic sometimes you must defer applying operators if they're followed by higher precedence operators or by parentheses when this happens you must apply the laterhigherprecedenceoperator firstthen go backward (to the leftand apply earlier operators figure evaluating *( + we could write an algorithm to carry out this kind of evaluation directly howeveras we notedit' actually easier to translate into postfix notation first how humans translate infix to postfix to translate infix to postfix notationyou follow similar set of rules to those for evaluating infix howeverthere are few small changes you don' do any arithmetic the idea is not to evaluate the infix expressionbut to rearrange the operators and operands into different formatpostfix notation the resulting postfix expression will be evaluated later as beforeyou read the infix from left to rightlooking at each character in turn as you go alongyou copy these operands and operators to the postfix output string the trick is knowing when to copy what if the character in the infix string is an operandyou copy it immediately to the postfix string that isif you see an in the infixyou write an to the postfix there' never any delayyou copy the operands as you get to themno matter how long you must wait to copy their associated operators knowing when to copy an operator is more complicatedbut it' the same as the rule for evaluating infix expressions whenever you could have used the operator to evaluate part of the infix expression (if you were evaluating instead of translating to postfix)you instead copy it to the postfix string